angular.js - angular ng-class里面可以用 {{}} 取值吗
迷茫
迷茫 2017-05-15 17:13:35
0
1
549

angular ng-class里面可以用 {{}} 取值吗

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(1)
为情所困

Thanks for the invitation, for all uses of ng-class, you can view the-many-ways-to-use-ngclass


Data

$scope.users = [
{
  id: 1,
  name: `Lolo`,
  icon: true
}, {
  id: 2,
  name: 'Semlinker',
  icon: false
}];

HTML Template

 <ul>
   <li ng-repeat="user in users" ng-class="{'tab': user.icon}">
      {{user.id}} - {{user.name}}
   </li>
 </ul>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template