一聚教程网:一个值得你收藏的教程网站

最新下载

热门教程

AngularJS 使用ng-repeat报错 [ngRepeat:dupes]

时间:2017-02-08 编辑:简简单单 来源:一聚教程网

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

热门栏目