angular.js
angular.js copied to clipboard
filter should be dependency injectable
Currently filter is not dependency injectable, which may be a desirable feature. Also need to update docs for the following page if filter is made injectable in the future: http://docs.angularjs.org/#!/api/angular.scope.$service
Yeah, this came up with Di yesterday. We should probably change the filter syntax so that the filter is a factory function just like services too. Otherwise the filter would need to be injected repeatedly for each invocation.
ex.
angular.filter('date', function($locale) {
return function(value, format) {
return $locale.formatDate(value, format);
};
});