0
爲什麼AngularJS多次調用ng-repeat過濾器?AngularJS。 ng-repeat中過濾器的奇怪行爲
例如:
控制器:
$scope.data = [1,2,3];
檢視:
<div ng-repeat="item in data">
{{ item | mySuperFilter }}
</div>
濾波器:
.filter('mySuperFilter', function(){
return function(v) {
console.log(v);
return v;
}
});
並導致控制檯:
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
爲什麼角度呢?
PS:對不起,我的英語
可能重複http://stackoverflow.com/questions/18309755/why-does-filter-trigger-some-many-times) – Stewie
對不起,我沒有找到它。 – ilya