← All recipes
Moderne licensed

Remove ComponentFactoryResolver

Recipe IDorg.openrewrite.angular.migration.remove-component-factory-resolverArtifact@openrewrite/recipes-angular

Replaces resolver.resolveComponentFactory(Component) with just Component and removes the ComponentFactoryResolver import. Since Ivy, ViewContainerRef.createComponent accepts the component class directly. ComponentFactoryResolver was deprecated in Angular 13 and removed in Angular 16.

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.remove-component-factory-resolver

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

mod config recipes npm install @openrewrite/recipes-angular