Boris D. Teoharov Boris D. Teoharov - 1 year ago 138
Javascript Question

use $filter service inside module.config

As per the AngularJS documentation it seems that it is only possible inject providers in

However, I have to configure some 3rd party service using its provider
and set it up like this:

ServiceXProvider.format = function format(x) { return $filter('date')(x, "yyyy-MM-dd"); }

is obviously a service and not a provider and I can not inject it into the

Is there any reasonable workaround for this scenario?

Answer Source

You can update a provider object in a run() block where you can inject services

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download