Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular JS: Why angular-filters errors with Unknown provider: defaultFilterProvider <- defaultFilter?

I put angular-filters in my application.js, but I still get the error:

Unknown provider: defaultFilterProvider <- defaultFilter

How do I fix this?

like image 414
mkelley33 Avatar asked Jan 15 '23 00:01

mkelley33


1 Answers

Although I'd already included angular-filters in my application, I had forgotten to add them to my requires array like so:

var myApp = angular.module("MyApp", ["ngResource", "ex.filters"]);

To get the angular-filters to work I had to put "ex.filters" in the array as shown above.

I discovered the solution by reading the tests at https://github.com/frapontillo/angular-filters/blob/master/test/default/defaultSpec.js

like image 102
mkelley33 Avatar answered Jan 17 '23 15:01

mkelley33