是否有任何“角度方式”来避免在 中显示重复项ng-repeat?
如果我们在数组中添加重复项,它会弹出[ngRepeat:dupes],这可以用ng-repeat="item in items track by $index". 好的。
但是,如果我们不想显示重复项怎么办?我曾想过在创建这样的数组时进行过滤:
if(!$scope.items.indexOf($scope.item ) == -1 ) {
$scope.items.push( $scope.item );
}
但是还有其他有角度的方式吗?