若是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
所以正確的作法是數組中最好不要放這種基本元素(包括字符串),最好放對象字符