- Expert Angular
- Mathieu Nayrolles Rajesh Gunasundaram Sridhar Rao
- 60字
- 2021-07-15 17:05:36
Handling the CSS classes
AngularJS provides the ng-class directive to include or exclude CSS classes. Similarly, Angular has the ngClass directive to apply or remove CSS classes based on the expression. Class binding is another better option provided by Angular to add or remove a CSS class.
AngularJS:
<div ng-class="{active: isActive}">
Angular:
<div [ngClass]="{active: isActive}"> <div [class.active]="isActive">
Notice the class binding applied to the second div in Angular.
推薦閱讀
- UI設計基礎培訓教程
- Java程序設計實戰教程
- Redis Applied Design Patterns
- Android和PHP開發最佳實踐(第2版)
- 編程卓越之道(卷3):軟件工程化
- Mastering Natural Language Processing with Python
- Internet of Things with Intel Galileo
- iOS應用逆向工程(第2版)
- Learning Data Mining with R
- HTML5入門經典
- Learning SciPy for Numerical and Scientific Computing(Second Edition)
- PySpark Cookbook
- 基于SpringBoot實現:Java分布式中間件開發入門與實戰
- Android應用開發深入學習實錄
- 代替VBA!用Python輕松實現Excel編程