angularjs - Iterating objects or arrays inside ng-repeat -


the json i'm passing view has objects , arrays inside of it. example:

{ name: "test", projects: [ { name: "project1", tasks: "task1" } ] } 

using ng-repeat, can (key, value) in items , given you'd expect, each key , stringified version of object or array.

is there 'best practice' iterating on objects , arrays inside ng-repeat?

just following answer, able figure out. simpler realized. used ng-repeat items arrays.

<div class="container" ng-repeat="item in items"> <table class="table table-striped table-bordered table-condensed">     <tr>         <th class="span3">name</th>         <td>{{ item.name }}</td>     </tr>     <tr>         <th class="span3">accounts</th>         <td>             <ul ng-repeat="account in item.accounts">                 <li>username: {{ account.username }}</li>                 <li>password: {{ account.password }}</li>             </ul>         </td>     </tr> </table> 


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -