Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/426.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 是否使用Angular根据重复项的数量设置类?_Javascript_Jquery_Angularjs - Fatal编程技术网

Javascript 是否使用Angular根据重复项的数量设置类?

Javascript 是否使用Angular根据重复项的数量设置类?,javascript,jquery,angularjs,Javascript,Jquery,Angularjs,我有一个填充了Angular.js数据的表: <table class="table"> <thead> <tr> <th>#</th> <th>First Name</th> <th>Last Name</th> <th>Username</th> </tr>

我有一个填充了Angular.js数据的表:

<table class="table">
    <thead>
      <tr>
        <th>#</th>
        <th>First Name</th>
        <th>Last Name</th>
        <th>Username</th>
      </tr>
    </thead>
    <tbody>
      <tr ng-repeat="t in tabledata">
        <td>00{{t.id}}</td>
        <td>{{t.firstName}}</td>
        <td>{{t.lastName}}</td>
        <td><a href="">{{t.userName}}</a></td>
      </tr>
    </tbody>
  </table>

#
名字
姓
用户名
00{{t.id}
{{t.firstName}
{{t.lastName}
如果数据行数>10,我想做的是向
标记添加另一个类


这可能吗?我该怎么做?我知道如何使用jQuery中的“平面”表来实现这一点,但我对Angular的动态中继器还不熟悉。

使用
ng类

<table ng-class="{'newClassName' : tabledata.length > 10 }">

谢谢。即使已经有一个类(如
中的类),也可以这样做吗?似乎有效,但它是正确的吗?@Steve——是的,没问题