多个ng-repeats - 通过多个级别启动属性

时间:2015-08-13 14:29:03

标签: angularjs angularjs-ng-repeat nested-loops ng-repeat

我尝试使用ng-repeat遍历四个级别,但ng-repeat在第三级之后失败。

如何将ng-repeat用于多次重复?

<tbody ng-repeat="company in companies">
     <tr>
         <td>{{company.name}}</td>
     </tr>           
     <tr ng-repeat-start="child in company.Children">
         <td>{{child.name}}</td>
     </tr>
     <tr ng-repeat-start="child2 in child.Children">
        <td>{{child2.name}}</td>
     </tr>
     <tr ng-repeat-end ng-repeat="child3 in child2.Children">
        <td>{{child3.name}}</td>
     </tr>
     <tr ng-repeat-end></tr>
</tbody>

我试图像这样结束两个循环:

<tr ng-repeat-end></tr>
<tr ng-repeat-end></tr>

然而,Angular并不检查必须关闭两个循环。你只能关闭一个循环,这就是我的问题。

0 个答案:

没有答案