[ngRepeat:dupes] Duplicates in a repeater are not allowed. Use 'track by' expression to specify uniq
2017-06-14 13:54
671 查看
错误原因
今天前台接收到后台提交的数据以后,在view进行ng-reapet绑定数据的时候出现以下脚本错误:
[ngRepeat:dupes] Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keys
上面这句代码大概的意思:错误是内容相同引起的。
view中的代码是这样写的:
[html] view
plain copy
print?
<span style="font-family:SimSun;font-size:18px;"><span ng-repeat="tempExaminant in item.examinant ">{{tempExaminant}}</span></span>
小编用fiddler跟踪了一下,的确是返回的数据中有重复的数据,不知道为什么angular的指令会有这样的限
制,那么如果我们必须显示重复数据怎么办呢,我们需要在ng-repeat后面添加track by $index
view中的代码改成这样:
[html] view
plain copy
print
accb
?
<span style="font-family:SimSun;"> <span ng-repeat="tempExaminant in item.examinant track by $index ">{{tempExaminant}}</span></span>
这样我们就可以解决遍历重复数据问题了。
今天前台接收到后台提交的数据以后,在view进行ng-reapet绑定数据的时候出现以下脚本错误:
[ngRepeat:dupes] Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keys
上面这句代码大概的意思:错误是内容相同引起的。
view中的代码是这样写的:
[html] view
plain copy
print?
<span style="font-family:SimSun;font-size:18px;"><span ng-repeat="tempExaminant in item.examinant ">{{tempExaminant}}</span></span>
小编用fiddler跟踪了一下,的确是返回的数据中有重复的数据,不知道为什么angular的指令会有这样的限
制,那么如果我们必须显示重复数据怎么办呢,我们需要在ng-repeat后面添加track by $index
view中的代码改成这样:
[html] view
plain copy
accb
?
<span style="font-family:SimSun;"> <span ng-repeat="tempExaminant in item.examinant track by $index ">{{tempExaminant}}</span></span>
这样我们就可以解决遍历重复数据问题了。
相关文章推荐
- [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
- [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 uni
- ng-repeat循环输出出现Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique
- ng-repeat出现环路输出Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique
- Error: [ngRepeat:dupes] Duplicates in a repeater are not allowed. Use 'track by' expression to speci
- [ISSUE]Error: [ngRepeat:dupes] Duplicates in a repeater are not allowed.
- Angular报错[ngRepeat:dupes] Duplicates in a repeater are not allowed.
- Duplicates in a repeater are not allowed in AngularJS
- "Your computer could not be joined to the domain. You have exceeded the maximum number of computer accounts you are allowed to create in this domain. Contact your system administrator to have this limit reset or increased."
- Broadcastreceiver components are not allowed to bind to services in android
- Duplicate range boundary values are not allowed in partition function boundary value list.
- Failed to load http://localhost:8080/team.php: Request header field x-jwt-header is not allowed by Access-Control-Allow-Headers in preflight response.
- 使用cocapods报错 [!] Your Podfile has had smart quotes sanitised. To avoid issues in the future, you should not use TextEdit for editing it. If you are not using TextEdit, you should turn off smart quotes
- XML methods are not allowed in a GROUP BY clause.XML不允许使用排序方法的处理
- Write operations are not allowed in read-only mode
- apache启动报错(98)Address already in use: make_sock: could not bind to address [::]:80
- Write operations are not allowed in read-only mode (FlushMode.NEVER/MANUAL): Turn your Session into FlushMode.COMMIT/AU
- Write operations are not allowed in read-only mode (FlushMode.NEVER)