ng-repeat不容許重複元素問題

[ngRepeat:dupes] Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keysexpress

ng-repeat不容許出現重複元素code

<li ng-repeat="item in items">  
    {{item}}  
</li>

解決方案ci

<li ng-repeat="item in items track by $index">  
    {{item}}  
</li>
相關文章
相關標籤/搜索