I am trying to create filterin angular, which can affect the way data is bound to a directive, similar to how a filter jsoncan be applied to an expression.
I have a lot of problems with this, although it seems that the definition of a filter is not enough to work on anything other than built-in expressions. I am absolutely sure that I have seen this before.
Question
Is it possible to create a filter that works internally with a directive? Like this?
<div ng-directive="Model.Target | filterName"></div>
Update
ng-modelwas just an example. I'm not looking for an existing filter, I'm not looking for how to apply filters, I'm not looking ng-repeat. I specifically want to create a new filter that can work with the directive.
Update 2
, angular ( 154 of filters.js) , . ;
.filter('sample', function () {
return function (obj) {
console.log("typoef: ", typeof obj);
}
});
;
<div data-ng-custom-directive="Model.Tags | sample"></div>
...
Uncaught TypeError: undefined
- , $scope.Model.Tags.
- , ng-model, . ng-model, , ng-repeat, ? , , , , ng-model, , , .