AngularJS 使用ng-repeat報(bào)錯(cuò) [ngRepeat:dupes]
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)文章
AngularJS使用ngOption實(shí)現(xiàn)下拉列表的實(shí)例代碼
這篇文章主要介紹了AngularJS使用ngOption實(shí)現(xiàn)下拉列表的實(shí)例代碼的相關(guān)資料,需要的朋友可以參考下2016-01-01Angular?結(jié)合?dygraphs?實(shí)現(xiàn)?annotation功能
這篇文章主要介紹了Angular?結(jié)合?dygraphs?實(shí)現(xiàn)?annotation,本文,我們直接結(jié)合 Angular 來(lái)演示,如何通過(guò) dygraphs 實(shí)現(xiàn)折線(xiàn)圖上的 annotation 的功能,需要的朋友可以參考下2022-08-08實(shí)例剖析AngularJS框架中數(shù)據(jù)的雙向綁定運(yùn)用
這篇文章主要介紹了AngularJS框架中數(shù)據(jù)的雙向綁定運(yùn)用實(shí)例,包括數(shù)據(jù)綁定中的關(guān)鍵函數(shù)與監(jiān)聽(tīng)器觸發(fā)的相關(guān)講解,需要的朋友可以參考下2016-03-03AngularJs實(shí)現(xiàn)分頁(yè)功能不帶省略號(hào)的代碼
這篇文章主要介紹了AngularJs實(shí)現(xiàn)分頁(yè)功能不帶省略號(hào)的代碼的相關(guān)資料,非常不錯(cuò)具有參考借鑒價(jià)值,感興趣的朋友一起看看吧2016-05-05angular6?Error:Debug?Failure?at?typeToString解決分析
這篇文章主要為大家介紹了angular6?Error:Debug?Failure?at?typeToString解決分析,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2023-11-11詳解angularjs跨頁(yè)面?zhèn)鲄⒂龅降囊恍﹩?wèn)題
這篇文章主要介紹了詳解angularjs跨頁(yè)面?zhèn)鲄⒂龅降囊恍﹩?wèn)題,小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧2018-11-11AngularJs中$cookies簡(jiǎn)單用法分析
這篇文章主要介紹了AngularJs中$cookies簡(jiǎn)單用法,結(jié)合實(shí)例形式分析了AngularJS使用$cookies存儲(chǔ)變量相關(guān)操作技巧與注意事項(xiàng),需要的朋友可以參考下2019-05-05angularjs實(shí)現(xiàn)天氣預(yù)報(bào)功能
這篇文章主要為大家詳細(xì)介紹了angularjs實(shí)現(xiàn)天氣預(yù)報(bào)功能,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2017-10-10