AngularJS ng-repeat数组有重复值的解决方法
前言大家都知道默认在ng-repeat的时候每一个item都要保证是唯一的,否则console就会打出error告诉你哪个key/value是重复的。如:$scope.items = [ "red", "blue", "yellow", "white", "blue"];这个数组blue就重复了,html这么遍历它<li ng-repeat="item in items">{{ item }}</li>控制台就会抛出一个错误:点击错...