The identifier used to resolve the class in the DI container.
Optional
init: InitDelegate<T, U>An optional initializer function to transform the dependency before injection.
If true, throws an error if the dependency is not found.
The resolved dependency or undefined if the dependency is not necessary and not found, or throws an error if the dependency is necessary and not found.
A DependencyResolutionError if the dependency is not found and necessary.
class MyClass {
@Inject<MyDependency>('MyDependencyIdentifier')
private myDependency!: MyDependency;
}
class MyClass {
@Inject('ILogger_', (x: ILogger_) => x.getLogger('Tags'), false)
private _logger?: ILogger;
}
A decorator to inject a dependency from a DI (Dependency Injection) container into a class property.