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

fix: TypeDI do not inject service #1241

Open
Mullayam opened this issue Sep 28, 2023 · 1 comment
Open

fix: TypeDI do not inject service #1241

Mullayam opened this issue Sep 28, 2023 · 1 comment
Labels
status: needs triage Issues which needs to be reproduced to be verified report. type: fix Issues describing a broken feature.

Comments

@Mullayam
Copy link

TypeDI was not able to inject sercie container in controller

Here is my code
i've tried all method written in documentation but still get error

image
image
image
image

Expected behavior

it should inject the dependencies and return json

Actual behavior

TypeError: this.test.getName is not a function
at BaseController.index (file:///E:/private/noidejs/nodets-pack/src/controllers/collection/base.controller.ts:14:28)
at ActionMetadata.callMethod (E:\private\noidejs\nodets-pack\node_modules.pnpm@enjoys+modules@1.1.1_class-transformer@0.5.1_class-validator@0.14.0\node_modules@enjoys\main\metadata\ActionMetadata.ts:252:44)
at E:\private\noidejs\nodets-pack\node_modules.pnpm@enjoys+modules@1.1.1_class-transformer@0.5.1_class-validator@0.14.0\node_modules@enjoys\main\RoutingControllers.ts:123:28
at processTicksAndRejections (node:internal/process/task_queues:95:5)

@Mullayam Mullayam added status: needs triage Issues which needs to be reproduced to be verified report. type: fix Issues describing a broken feature. labels Sep 28, 2023
@attilaorosz
Copy link
Member

attilaorosz commented Sep 28, 2023

Did you import reflect-metadata?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs triage Issues which needs to be reproduced to be verified report. type: fix Issues describing a broken feature.
Development

No branches or pull requests

2 participants