Skip to content

Migrate from constructor-based dependency injection to inject() function #50757

@Mikastark

Description

@Mikastark

Which @angular/* package(s) are relevant/related to the feature request?

upgrade

Description

Hi Angular team :)

First of all, thanks for the hard work and the wonderful new features (special mentions to signals and input-route binding).

Taking from what was said in the last Building Games and Q/A, I think it could be very great to add a schematics to migrate from constructor-based dependency injection to the new inject() function.

Angular team already did something similar in v16 for Standalone APIs and I personally really appreciated what was done.

Proposed solution

Add some clarification on the official documentation to expose advantages of inject() function usage

Alternatives considered

Add a schematics to simplify migration from constructor-based injection.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: migrationsIssues related to `ng update`/`ng generate` migrations

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions