Angular项目 Error: [ngRepeat:dupes] Duplicates in a repeater are not allowed.报错
在angular的项目里,一不小心就会出现这个错误[ngRepeat:dupes] ,这个问题是因为内容有重复引起的解决起来挺简单
在对应的ng-repeat指令中增加track by $index,意思是用索引值识别
例:
<p ng-repeat="item in ages track by $index"> {{item}} </p>
这样,报错就消失啦
- 上一篇 »[Swift]LeetCode1209. 删除字符串中的所有相邻重复项 II | Remove All Adjacent Duplicates in String II
- 下一篇 »mysql 不能执行delete检查safe-updates模式 解除输入的安全模式,Error Code: 1175. You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column To disable safe mode, toggle the option in Preferences -> SQL Queries