Closed ivan-slepchenko closed 7 years ago
Yeah, because the only way to know something was instantiated behind the scenes is to receive a callback from the injector. Btw, there are few other way for doing it.
annotationProvider.parse( instance );
So, what you should understand, if you do manually new MyClass()
, there's no way for the system to be notified and provide data.
Hope that helps.I would say I don't agree on this one, as commented in the issue, the instance is created by the injector, not directly by the user, why should he know that in this case the annotations won't be parsed in the same way?
Also, why adding IInjectorContainer makes the difference in this case? I think I get the point myself, but I consider this should be documented somewhere.
CLangTextList implements IAnnotationParsable but its not enough to have the fields injected, so I need to implement InjectorContainer too. This happens when i map it in a module, with injector.mapToASingleton