← All recipes
Moderne licensed

Find deprecated providedIn values

Recipe IDorg.openrewrite.angular.search.find-provided-in-deprecated-usageArtifact@openrewrite/recipes-angular

Finds usages of providedIn: 'any' and providedIn: NgModule in @Injectable and InjectionToken declarations. These were deprecated in Angular 15. Use providedIn: 'root' or add the service to NgModule.providers instead.

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.search.find-provided-in-deprecated-usage

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

mod config recipes npm install @openrewrite/recipes-angular