ShaqCode
ShaqCode

Reputation: 381

ng-repeat in ng-repeat with Angular

I am working on a project where i would like to combine two ng-repeat toghether, has anyone an idea as to how to do this?

Something like this:

<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>

Upvotes: 1

Views: 259

Answers (1)

Michael Kang
Michael Kang

Reputation: 52847

This should work:

<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>

Upvotes: 1

Related Questions