标签: javascript angularjs angularjs-ng-repeat ng-repeat
我有一个嵌套的ng-repeat如下:
<div ng-repeat="item_l in list1"> <div ng-repeat="item_f in list2"> {{item_f}} {{item_l}} </div> </div>
它给了我大约20个结果,但我只想要其中的5个。怎么做?
答案 0 :(得分:5)
您可以使用limitTo
limitTo
<div ng-repeat="item_l in list1"> <div ng-repeat="item_f in list2 | limitTo : 5"> {{item_f}} {{item_l}} </div> </div>
DEMO APP