Function injectable

  • Registers a class as an automatically injectable for dependency injection container.

    Parameters

    • autoInjecions: DependencyId[]

      injections that should be injected to dependency constructor while it creates

    Returns any

    A class decorator function.

    Note: During dependency resolution, any container that does not have an instance for the specified dependency identifier will create an instance of the decorated class. However, if a container already has an instance with that identifier prior to resolution, the decorated class will be ignored by that container.

  • Registers a class as an automatically injectable for dependency injection container.

    Parameters

    • OptionaldependencyId: DependencyId

      Optional dependency identifier. If omitted, the class name is used.

    • OptionalautoInjecions: DependencyId[]

      injections that should be injected to dependency constructor while it creates

    Returns any

    A class decorator function.

    Note: During dependency resolution, any container that does not have an instance for the specified dependency identifier will create an instance of the decorated class. However, if a container already has an instance with that identifier prior to resolution, the decorated class will be ignored by that container.