- 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.
推薦閱讀
- Learning Java Functional Programming
- Learn to Create WordPress Themes by Building 5 Projects
- JIRA 7 Administration Cookbook(Second Edition)
- Bulma必知必會
- 網絡爬蟲原理與實踐:基于C#語言
- R大數據分析實用指南
- 零基礎入門學習Python(第2版)
- Unity 2017 Mobile Game Development
- Android Wear Projects
- 持續輕量級Java EE開發:編寫可測試的代碼
- QPanda量子計算編程
- Java7程序設計入門經典
- 系統分析師UML用例實戰
- Mastering Node.js
- 歐姆龍PLC編程指令與梯形圖快速入門