为情所困2017-05-15 17:15:35
谢邀,ng-class的所有用法,可以查看 the-many-ways-to-use-ngclass
数据
$scope.users = [
{
id: 1,
name: `Lolo`,
icon: true
}, {
id: 2,
name: 'Semlinker',
icon: false
}];
HTML模板
<ul>
<li ng-repeat="user in users" ng-class="{'tab': user.icon}">
{{user.id}} - {{user.name}}
</li>
</ul>