Angularjs $filter not working with uglify

141 Views Asked by At

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

1

There are 1 best solutions below

1
On

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.