← All recipes
Moderne licensed

Replace InjectFlags with options object

Recipe IDorg.openrewrite.angular.migration.replace-inject-flagsArtifact@openrewrite/recipes-angular

Replaces deprecated InjectFlags enum usage in inject() calls with the corresponding options object. For example, inject(MyService, InjectFlags.Optional) becomes inject(MyService, { optional: true }).

Single recipeProprietary

Usage

This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.

mod run . --recipe org.openrewrite.angular.migration.replace-inject-flags

If the recipe isn’t available locally, install it with:

mod config recipes npm install @openrewrite/recipes-angular