• Inject Decorator Factory

    Prefer using Autowired instead of this.

    Automaticaly wire up a dependency into a class property. Any Service, Entity, or Factory can be injected.

    When injecting a Factory, args can be provided to pass into the Factory.

    Example

    class MyClass {
    @Entity("Logger")
    loggger!: Logger;
    }

    Example

    Example using Factory

    class MyClass {
    @Entity("Logger", { args: ["MyClass"] })
    logger!: Logger;
    }

    Returns

    • a property decorator

    Parameters

    • name: string

      provide the name

    • Optional options: Omit<InjectOptions, "name">

      optional params

    Returns PropertyDecorator

Generated using TypeDoc