The dependencies to provide upon initialisation of this service. These will be provided to the service as arguments to its constructor. They must be valid identifiers in the container the service shall be executed under.
A decorator which is then used upon a class.
This is a TypeScript decorator.
Here is an example:
@Service([ ])
class OtherService { }
@Service([OtherService])
class MyService {
constructor (private otherService: OtherService) { }
}
Marks class as a service that can be injected using Container.
The options allow customization of how the service is injected.
By default, the service shall be registered upon the defaultContainer
container.
The options to use for initialisation of the service. Documentation for the options can be found in ServiceOptions.
The dependencies to provide upon initialisation of this service. These will be provided to the service as arguments to its constructor. They must be valid identifiers in the container the service shall be executed under.
A decorator which is then used upon a class.
This is a TypeScript decorator.
Here is an example:
const OTHER_SERVICE = new Token<OtherService>();
@Service({ id: OTHER_SERVICE }, [ ])
class OtherService { }
@Service([OTHER_SERVICE])
class MyService {
constructor (private otherService: OtherService) { }
}
Marks class as a service that can be injected using Container.
The options allow customization of how the service is injected.
By default, the service shall be registered upon the defaultContainer
container.
The options to use for initialisation of the service. Documentation for the options can be found in ServiceOptions. The options must also contain the dependencies that the service requires.
If found, the specified dependencies to provide upon initialisation of this service. These will be provided to the service as arguments to its constructor. They must be valid identifiers in the container the service shall be executed under.
A decorator which is then used upon a class.
This is a TypeScript decorator.
Here is an example:
const OTHER_SERVICE = new Token<OtherService>();
@Service({ id: OTHER_SERVICE, dependencies: [ ] })
class OtherService { }
@Service({ dependencies: [OtherService] })
class MyService {
constructor (private otherService: OtherService) { }
}
Generated using TypeDoc
Marks class as a service that can be injected using Container. Uses the default options, wherein the class can be passed to
.get
and an instance of it will be returned. By default, the service shall be registered upon thedefaultContainer
container.