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

Property Injection changed with recent Typescript versions. #90

Open
danelowe opened this issue Mar 19, 2022 · 0 comments
Open

Property Injection changed with recent Typescript versions. #90

danelowe opened this issue Mar 19, 2022 · 0 comments

Comments

@danelowe
Copy link

I was just having a look into this library and came across an issue with recent Typescript (4.3.5)

TLDR - Property injection needs the declare keyword. (or useDefineForClassFieldsset to false in tsconfig)

@Inject
private declare helloService: HelloService;

I can look at submitting a PR for changing the readme if I get some time and look further into this library.

The issue is described well in the Typescript 3.7 release notes.

The useDefineForClassFields now defaults to true as of Typescript 4.x. I'd be inclined to leave it as true based on their description of it being the most likely standard going forward.

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

1 participant