Skip to content

Injection not working with React 16.8.6 #19

Description

@fljmayer

I am on React 16.8.6 and TypeScript 3.4.3, and I followed the instructions as much as possible. My project is just a small proof-of-concept with a single @Injectable service, a single @Injected attribute (see below) and a simple @Module({ providers: [ContentService] }) on the main application component. One exception is that I had to allow for the injected attribute to be uninitialized:
@Inject contentService!: ContentService;

However, when componentDidMount() tries to call a method on contentService, the attribute is undefined.

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