The type of the class whose instance is to be registered.
The identifier used to register the instance in the DI container.
Optional
init: InitDelegate<TargetType & (new (..._args: unknown[]) => InstanceType<TargetType>), InstanceType<TargetType>>An optional initializer function which get the constructor of the class as input and returns an instance of the class.
Optional
deprecated: booleanIf true, the dependency is deprecated and a warning is logged only once upon the first resolution of the dependency.
The decorator function to be applied on the class.
Rest
...args: unknown[]@RegisterInstance('MyClassInstanceIdentifier', (constructor) => new constructor())
class MyClass {
// ...
}
Use Register instead. This decorator already uses the Register decorator internally.
A decorator to register an instance of a class in the DI (Dependency Injection) container.