[AngularJS] Using AngularJS's ngClass

.blue{
   color: blue
}

.bold{
   font-weight: bold;
}

.large{
   font-size: 40px;
}

 

ngClass can accept an array:

<div ng-claass="[blue, large, boild]">ngClass</div>

 

ngClass can take a string:

<div ng-claass="blue large boild">ngClass</div>

 

ngClass can take object:

<div ng-class="{bold: vm.shouldBold}" >ngClasss</div>

 

posted @ 2016-01-10 16:06  Zhentiw  阅读(174)  评论(0编辑  收藏  举报