@lppedd/di-wise-neo - v0.19.0
    Preparing search index...

    Function Inject

    • Parameter decorator that injects the instance associated with the given class.

      Throws an error if:

      • The class is not registered in the container.
      • A circular dependency is detected. Use function injection with injectBy if resolving circular dependencies is necessary.

      Type Parameters

      • Instance extends object

      Parameters

      Returns ParameterDecorator

    • Parameter decorator that injects the value associated with the given token.

      Throws an error if:

      • The token is not registered in the container.
      • A circular dependency is detected. Use function injection with injectBy if resolving circular dependencies is necessary.

      Type Parameters

      • Value

      Parameters

      Returns ParameterDecorator

    • Parameter decorator that injects the value associated with the given token.

      Allows referencing a token declared later in the file by using the tokenRef helper function.

      Throws an error if:

      • The token is not registered in the container.
      • A circular dependency is detected. Use function injection with injectBy if resolving circular dependencies is necessary.

      Type Parameters

      • Value

      Parameters

      Returns ParameterDecorator

      class Wizard {
      constructor(@Inject(tokenRef(() => Wand)) readonly wand: Wand) {}
      }
      // Other code...
      class Wand {}