了解 : angular $filter stateful
{{ abc | myFilter }}
angular.module('myStatefulFilterApp', [])
.filter('decorate', ['decoration', function(decoration) {
function decorateFilter(input) {
return decoration.symbol + input + decoration.symbol;
}
decorateFilter.$stateful = true;//当digest abc 没有更新,filter 就不会跑
return decorateFilter;
}])