若是ng-repeat绑定的数组中元素有重复,数组
如对象
$scope.data = [1,2,2]字符串
ng-repeat="value in data" //这种写法就会报错,ngRepeat:dupes引用
能够经过 ng-repeat="value in data track by $index" 这种方式来解决scope
可是若是引用了 ace的编辑组件,将编辑组件放到ng-repeat中就会报错,不能有 track by $indexco
所以正确的作法是数组中最好不要放这种基本元素(包括字符串),最好放对象字符