di.js icon indicating copy to clipboard operation
di.js copied to clipboard

Modules should isolate configs

Open jimbru opened this issue 10 years ago • 1 comments

Hi di.js folks,

I recently opened an issue on the core Angular project asking for a way to isolate service/provider configuration per-module. It was closed as infeasible for v1.x, but @caitp suggested I open an issue here to put it on the radar for v2.

Original issue is here: https://github.com/angular/angular.js/issues/8404

Thanks!

jimbru avatar Jul 29 '14 23:07 jimbru

Thanks @jimbru. I agree that the current behavior in 1.x is very leaky.

We don't have this problem in di.js, because there are no "stateful providers". There is a discussion about configuration (see #56). As long as we keep it declarative, this issue won't exist.

In a child injector, you can register a different configuration. It won't affect parent/sibling injectors.

vojtajina avatar Jul 30 '14 17:07 vojtajina