Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to inject method parameter #1540

Open
imcm7 opened this issue Oct 6, 2023 · 1 comment
Open

How to inject method parameter #1540

imcm7 opened this issue Oct 6, 2023 · 1 comment

Comments

@imcm7
Copy link

imcm7 commented Oct 6, 2023

How to inject method parameter

@inject()
Class Name {

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

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants