• Decorator to identify a property, or constructor argument, as a dependency to be injected

    Parameters

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

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

        • target: any
        • propertyKey: 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;
    }