官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 兴城市| 宜丰县| 城固县| 福州市| 行唐县| 江达县| 日喀则市| 马尔康县| 永平县| 莱阳市| 友谊县| 翼城县| 英吉沙县| 香格里拉县| 尉氏县| 同江市| 应用必备| 安龙县| 宿州市| 甘南县| 青神县| 共和县| 缙云县| 小金县| 行唐县| 赞皇县| 成安县| 浦东新区| 博罗县| 凤山县| 天全县| 新巴尔虎左旗| 台山市| 神木县| 东平县| 尚志市| 大庆市| 兴海县| 来凤县| 胶南市| 隆昌县|