如题.无论什么操作,只要当前页面有filter,都会执行一次. 就算点个按钮,按钮事件里无任何操作,也会执行一次filter... html: <div ng-controller="MyController"> <input type="text" ng-model="message"> {{message |TestFilter}} <button ng-click="buttonChick1()">按钮</button> {{ greeting.text}} <div ng-repeat="a in testList"> {{a.name}} </div> <test></test> </div>
filter:
testFilterModule.filter("TestFilter",function(){ var face=function(input){ console.log("过滤器filter执行"); return input; }; return face; });
qq_郭靖_03148326