Function inject

Registers an injection for dependency injection.

  • Parameters

    • OptionaldependencyId: DependencyId | DependencyClass<any>

      Optional dependecy identifier. If omitted, the property name is used.

    Returns (_value: unknown, context: ClassFieldDecoratorContext) => void

    A decorator function for class fields.

    The decorated field will receive its dependency from the same container as the injection owner.