ng-repeat 2层循环

<li ng-repeat="a in b">

<a>{{a.id}}</a> //这里是循环数组出id

<ul>

    <li ng-repeat="">{{}}</li> //这里该怎么循环出arr的name?

</ul>

</li>

数据结构

[

{"id":1,

  "ps":1,

  "arr":[{"name":2,"user":13},{"name":3,"user":24}]

},

{"id":2,

 "ps":2,

 "arr":[{"name":4,"user":34},{"name":5,"user":45}]

}

]


慕雪6442864
浏览 702回答 1
1回答

DIEA

<li ng-repeat="a in b">&nbsp; &nbsp; <a>{{a.id}}</a>&nbsp;&nbsp; &nbsp; <ul>&nbsp; &nbsp; &nbsp; &nbsp; <li ng-repeat="c in a.arr">{{c.name}}</li>&nbsp; &nbsp; </ul></li>
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript