• Decorator to mark a property or constructor parameter as a dependency that should be automatically injected by the IoC container.
    When applied to a property or constructor parameter, the container will resolve and inject the specified dependency at runtime.

    Parameters

    Returns ((target: any, propertyKey?: PropertyKey, parameterIndex?: number) => void)

      • (target, propertyKey?, parameterIndex?): void
      • Parameters

        • target: any
        • OptionalpropertyKey: PropertyKey
        • OptionalparameterIndex: number

        Returns void

    class SomeClass {
    private anotherDependency: DependencyType;

    constructor(@inject("AnotherDependency") anotherDependency: DependencyType) {
    this.anotherDependency = anotherDependency;
    }
    }
    class SomeClass {
    @inject("AnotherDependency") private anotherDependency: DependencyType;
    }