WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Property Injection changed with recent Typescript versions. #90

@danelowe

Description

@danelowe

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions