用Angular重复ng-repeat in ng-repeat

时间:2014-09-23 07:51:09

标签: angularjs ng-repeat

我正在开展一个项目,我想将两个ng-repeat结合起来,有没有人知道如何做到这一点?

这样的事情:

<th ng-repeat="header in headers">                                                             
  <ul class="dropdown-menu" aria-labelledby="dropdownMenu">                                               
      <li class="divider"></li>
      <li ng-repeat="row in rows">
         **{{row.{{header.data}}}**} //what is the right syntax
      </li>
  </ul>    
</th>

1 个答案:

答案 0 :(得分:1)

这应该有效:

<th ng-repeat="header in headers">                                                             
  <ul class="dropdown-menu" aria-labelledby="dropdownMenu">                                               
      <li class="divider"></li>
      <li ng-repeat="row in rows">
         {{row[header.data]}}
      </li>
  </ul>    
</th>