您的位置:首页 > 移动开发

How to conditionally apply CSS styles in AngularJS?

2014-09-22 12:50 483 查看
http://stackoverflow.com/questions/13813254/how-do-i-conditionally-apply-css-styles-in-angularjs

when using ng-repeat and some class needs to be different,we can use:

<div ng-repeat="item in items" ng-class="{'Name': Your Condition}">
... HTML to display the item ...
<input type="checkbox" ng-model="item.checked">
</div>
For example:

<div ng-repeat="item in items" ng-class="{'pending-delete': item.checked}">
... HTML to display the item ...
<input type="checkbox" ng-model="item.checked">
</div>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  angularjs css html