I just made a simple custom filter to strip some chars from a string
angular.module('myApp.filters').filter('myFilter', function() {
return function(string) {
string = string.replace('[', '');
string = string.replace(']', '');
string = string.replace('","', ', ');
string = string.replace('"', '');
return string;
}
});
then in the template
<td>[[res[0].names | myFilter]]</td>
but I keep getting this error:
Unknown provider: myFilterFilterProvider <- myFilterFilter
I also tried to inject this filter in the controller responsible for that template but no luck. Am I missing something?
myApp.filtersas a dependency in you main app module or another module that is already listed as a dependency?ng-appin html isng-app="myApp.filters"? Create a demo that reproduces problemng-app. Need to see how you configured controller module to help more