Optional
containerOptionally, a container to register the service under. By default, this is the global container.
The dependencies of the service's constructor. These are wrapped objects.
Indicates whether a new instance should be created as soon as the class is registered. By default the registered classes are only instantiated when they are requested from the container.
Usage of this option is discouraged, as it makes code harder to test and more complex to understand. In the context of something like a database service, it may be wiser to provide an initializer method which can then be called from your root service.
Note: This option is ignored for transient services.
Optional
factoryFactory function used to initialize this service. Can be regular function ("createCar" for example), or other service which produces this instance ([CarFactory, "createCar"] for example).
If any dependencies were declared, these are passed to the factory.
ServiceFactory
Unique identifier of the referenced service.
Allows to setup multiple instances the different classes under a single service id string or token.
The injection scope for the service.
singleton
service always will be created in the default container regardless of who registering itcontainer
scoped service will be created once when requested from the given containertransient
service will be created each time it is requestedClass definition of the service what is used to initialize given service. This property maybe null if the value of the service is set manually. If id is not set then it serves as service id.
Instance of the target class.
Generated using TypeDoc
Service metadata is used to initialize service and store its state.