I'm trying to implement a custom filter, but I get the following error:
Error: [$injector:unpr] Unknown provider: removeCharsFilterProvider <- removeCharsFilter
The structure of my project is as follow...
app.js:
var app = angular.module('myApp', ['ionic'])
myController.js:
app.controller('myController', ['$scope', 'removeChars',
function($scope, removeChars) {
//...
}
]);
removeCharsFilter.js:
app.filter('removeChars', function() {
return function(input) {
return input.replace(/-/g, '').replace(/>/g, '');
};
});
myView.html:
<div ng-controller="myController">
<p>{{person.name | removeChars}}</p>
</div>
index.html
<!-- your app's js -->
<script src="js/app.js"></script>
<!-- filters -->
<script src="js/filters/removeCharsFilter.js"></script>
<!-- controllers -->
<script src="js/controllers/myController.js"></script>
I have no idea why this is happening, As far as I know this is supposed to work. Can you see anything that I'm missing?