标签:style key code disabled value false 括号 div ble
方法1.逻辑在后面的中括号里面
ng-class="{true : ‘checker disabled‘,false : ‘checker‘ }[selectAllButton]"
方法2.key为class 成立条件为对应的value 为true
ng-class="{‘checker disabled‘ : item.disab, ‘checker‘ : !item.disab}"
方法3.用{{ }} 包着表达式 不推荐,这样样式跑到contruller里面去了,混杂
ng-class="{{bClass}}” $scope.bClass = "{‘red‘:true,‘green‘:false}"
标签:style key code disabled value false 括号 div ble
原文地址:https://www.cnblogs.com/zhoulin1234/p/9587955.html