Class decorator that sets the class scope to Container and enables eager instantiation when the class is registered in the container.
This causes the container to create and cache the instance of the class immediately, instead of deferring it until the first resolution.
If the class cannot be resolved at registration time, registration fails.
Example:
@EagerInstantiate()class Wizard {}// Wizard is registered with Container scope, and an instance// is created and cached immediately by the containercontainer.register(Wizard); Copy
@EagerInstantiate()class Wizard {}// Wizard is registered with Container scope, and an instance// is created and cached immediately by the containercontainer.register(Wizard);
Class decorator that sets the class scope to Container and enables eager instantiation when the class is registered in the container.
This causes the container to create and cache the instance of the class immediately, instead of deferring it until the first resolution.
If the class cannot be resolved at registration time, registration fails.
Example: