欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

AngularJS 使用ng-repeat報(bào)錯(cuò) [ngRepeat:dupes]

 更新時(shí)間:2017年01月19日 11:11:17   投稿:lqh  
這篇文章主要介紹了AngularJS 使用ng-repeat報(bào)錯(cuò) [ngRepeat:dupes] 的相關(guān)資料,需要的朋友可以參考下

AngularJS 使用ng-repeat報(bào)錯(cuò)

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

ng-repeat報(bào)錯(cuò)

   
<div ng-init="words = ['高校','高校','高校']" ng-repeat="word in words"> 
  {{word}} 
</div> 

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

  發(fā)現(xiàn)是因?yàn)橄嗤膬?nèi)容重復(fù)引起,解決方案

<div ng-init="words = ['高校','高校','高校']" ng-repeat="word in words track by $index"> 
  {{word}} 
</div> 

在ng-repeat后面加上

track by $index 

感謝閱讀,希望能幫助到大家,謝謝大家對(duì)本站的支持!

相關(guān)文章

最新評(píng)論