[ngRepeat:dupes] Duplicates in a repeater are not allowed. Use 'track by' expression to specify uniq
生活随笔
收集整理的這篇文章主要介紹了
[ngRepeat:dupes] Duplicates in a repeater are not allowed. Use 'track by' expression to specify uniq
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
angularjs 使用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?
轉(zhuǎn)載于:https://www.cnblogs.com/laneyfu/p/4747491.html
總結(jié)
以上是生活随笔為你收集整理的[ngRepeat:dupes] Duplicates in a repeater are not allowed. Use 'track by' expression to specify uniq的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 深信服技术认证之Openstack云平台
- 下一篇: 在WORD中插入带圈的数字的序号