[ngRepeat:dupes] Duplicates in a repeater are not allowed. Use 'track by' expression to specify uniq
来源:互联网 发布:海奇软件app 编辑:程序博客网 时间:2024/06/03 19:23
错误原因
今天前台接收到后台提交的数据以后,在view进行ng-reapet绑定数据的时候出现以下脚本错误:
[ngRepeat:dupes] Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keys
上面这句代码大概的意思:错误是内容相同引起的。
view中的代码是这样写的:
<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中的代码改成这样:
<span style="font-family:SimSun;"> <span ng-repeat="tempExaminant in item.examinant track by $index ">{{tempExaminant}}</span></span>
这样我们就可以解决遍历重复数据问题了。
1 0
- [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 uniq
- [ngRepeat:dupes] Duplicates in a repeater are not allowed. Use 'track by' expression to specify uni
- Error: [ngRepeat:dupes] Duplicates in a repeater are not allowed. Use 'track by' expression to speci
- ng-repeat循环输出出现Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique
- Angular报错[ngRepeat:dupes] Duplicates in a repeater are not allowed.
- Duplicates in a repeater are not allowed in AngularJS
- angularjs[ngRepeat:dupes]
- use /Zm to specify a higher limit
- in-source builds are not allowed
- Broadcastreceiver components are not allowed to bind to services in android
- How to use Regular Expression in LotusScript
- you are not authorized to use service
- Subqueries are not allowed in this context. Only scalar expressions are allowed.
- ORA-00979: not a GROUP BY expression
- Use 'mysqld --thread_stack=#' to specify a bigger stack.
- 建造者模式
- c++ 加载so动态库中的资源
- Java程序员必须知道的10个调试技巧
- JAVA的静态时多态和动态时多态
- XCode怎么搜索图片文件
- [ngRepeat:dupes] Duplicates in a repeater are not allowed. Use 'track by' expression to specify uniq
- gcc编译程序的四个阶段(预处理-编译-汇编-链接)
- Linux vim Java
- 5-16 求符合给定条件的整数集 (15分)
- 【一天一道LeetCode】#121. Best Time to Buy and Sell Stock
- 7_4_K题 Triangle Counting 题解 [uva 11401](计数)
- Go语言学习笔记7
- 加解密 签名
- Program4_G