InversifyJS icon indicating copy to clipboard operation
InversifyJS copied to clipboard

How to inject method parameter

Open imcm7 opened this issue 1 year ago • 1 comments

How to inject method parameter

@inject()
Class Name {

    doSomething(
        @inject() test: string
    ) {
        console.log(string);
    }

imcm7 avatar Oct 06 '23 16:10 imcm7

This question appears to be out of context. The primary role of a DI (Dependency Injection) container is to inject dependencies into a constructor rather than injecting parameters into arbitrary functions. It is highly likely that you're attempting to achieve a goal that this library was not designed for.

skalinkin avatar Oct 11 '23 13:10 skalinkin