angularjs Error: [ngRepeat:dupes] http://errors.angularjs.org/1.5.8/ngRepeat/dupes?
来源:互联网 发布:数据库用户权限设置 编辑:程序博客网 时间:2024/06/05 06:44
出现这个错误的原因是如果页面中使用了ng-repeat,angularjs默认是根据里面的内容判断是否相同的,如果里面出现相同的内容就会报错,这里要注意的是,比如如下的内容
ng-repeat="user in [1,1]"
一般在实际开发中,我们一般是一个数组存一个对象, 这是里面的值都是Object,如下面的保存
ng-repeat="user in [{user:1},{user:2}]"
其实数组里面保存的是:
[Object,Object]
这时就会抛出Error: [ngRepeat:dupes] 这个错误,解决的方法也很简单,在ng-repeat中加入如下代码(注意:如果有filter这些的时候,这段代码要加载最后面)如:
track by $index
ng-repeat="user in users | filter:{nick:searchNick} track by $index"
0 0
- angularjs Error: [ngRepeat:dupes] http://errors.angularjs.org/1.5.8/ngRepeat/dupes?
- angularjs[ngRepeat:dupes]
- Error: [ngRepeat:dupes] Duplicates in a repeater are not allowed. Use 'track by' expression to speci
- angularjs ngrepeat filter
- AngularJs ngList、ngRepeat、ngModelOptions
- Angularjs中ngRepeat遍历出错
- [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
- [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
- Angular报错[ngRepeat:dupes] Duplicates in a repeater are not allowed.
- angular.min.js:118 Error: [ng:areq] http://errors.angularjs.org/1.5.8/ng/areq?
- angular.min.js:118 Error: [ng:areq] http://errors.angularjs.org/1.5.8/ng/areq?
- Error: [ng:areq] http://errors.angularjs.org...undefined
- Error: [ng:areq] http://errors.AngularJS.org/1.5.8/ng/areq?p0=HelloCtrl&p1=not%20a%20function%2C%20g
- 如何在angularJS深层嵌套ngRepeat中获取不同层级的$index
- ngRepeat问题
- 机器学习小组知识点18:伽马分布(Gamma Distribution)
- VTK数据结构2
- 基础C语音编程时常犯的错误
- mybatis用association指定外键结合select实现级联属性查询
- X86操作系统与X64操作系统的区别
- angularjs Error: [ngRepeat:dupes] http://errors.angularjs.org/1.5.8/ngRepeat/dupes?
- 二维数组与指针
- SQLite3 小技巧
- u-boot器件驱动模型(Device&Drivers)之链接器的秘密
- 实时查询引擎 - 构建于HDFS之上的Greenplum: HAWQ
- PMP学习笔记之第13章 项目干系人管理 ——13.1识别干系人
- 机器数及真值
- 算法的基本概念
- 深入理解通过Collections将集合转换为线程安全类集合