Angularjs $filter not working with uglify

I am using webpack + uglifyjs-webpack-plugin + ng-annotate-webpack-plugin in an angularjs app when doing a build everything seems to be working fine until I hit a piece of code that it is using $filter("currency") or $filter("date"). and the console throws the following error

Error: [$injector:unpr] Unknown provider: eProvider <- e <- $locale <- currencyFilter

Error: [$injector:unpr] Unknown provider: eProvider <- e <- $locale <- dateFilter

Upvotes: 0

Views: 138

Answers (1)

Ao Li
Ao Li

Reputation: 71

another possible reason is because you pack filter files in wrong order, try to pack filter files before the controller files which is using the filter.

Upvotes: 0

Related Questions