Error: [ngRepeat:dupes] what does this mean?

旧时模样 提交于 2019-12-03 23:33:32
Sourabh Agrawal

Occurs if there are duplicate keys in an ngRepeat expression. Duplicate keys are banned because AngularJS uses keys to associate DOM nodes with items.

This means that $scope.wines have some values which are duplicate.

You can also refer this post : Angular ng-repeat Error "Duplicates in a repeater are not allowed."

Y. Tiwari

It is true that AngularJS uses keys to associate DOM nodes with items. So, you can solve by adding "track by $index".

It will look like this

ng-repeat="wine in wines track by $index"

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!