angularjs api文档|AngularJS 使用ng-repeat报错

时间:2021-05-30  来源:js教程  阅读:

AngularJS 使用ng-repeat报错

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

ng-repeat报错

 代码如下

  {{word}}

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

  发现是因为相同的内容重复引起,解决方案

 代码如下

  {{word}}

在ng-repeat后面加上

 代码如下 track by $index

angularjs api文档|AngularJS 使用ng-repeat报错

http://m.bbyears.com/wangyezhizuo/120638.html

推荐访问:angularjs2 angularjs下载 angularjs自定义指令 angularjs和vue的区别
相关阅读 猜你喜欢
本类排行 本类最新