为情所困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>