You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for the framework, which provides perfect experience on dependency injection in my application.
However when I'm using the framework, I find that the providers registered in the root/parent scope will only be invoked in the registered scope. For example the test case blow:
I would expect the service provider can be injected in the root scope, and can be invoked correctly in each forked scope, with correct runtime values. In current framework, the test case will fail when invoking *SomeService, with error message:
Failed to invoke service: DI: could not find service someVal, available services: *SomeService, path: *SomeService -> someVal
I read the code and find that when creating scopes, the services are not deep copied to the scoped injector, so the child scopes are using the same service instance in the parent scope. It's the same with Injector.Clone() method since it also only shadow copies the services. It would be best if each injector can have its own provider management namespace and invoke the owning and inheriting providers independently.
The text was updated successfully, but these errors were encountered:
Thanks for the framework, which provides perfect experience on dependency injection in my application.
However when I'm using the framework, I find that the providers registered in the root/parent scope will only be invoked in the registered scope. For example the test case blow:
I would expect the service provider can be injected in the root scope, and can be invoked correctly in each forked scope, with correct runtime values. In current framework, the test case will fail when invoking
*SomeService
, with error message:I read the code and find that when creating scopes, the services are not deep copied to the scoped injector, so the child scopes are using the same service instance in the parent scope. It's the same with
Injector.Clone()
method since it also only shadow copies the services. It would be best if each injector can have its own provider management namespace and invoke the owning and inheriting providers independently.The text was updated successfully, but these errors were encountered: