← All recipes
Moderne licensed

Migrate <p-messages> to <p-message> with @for loop

Recipe IDorg.openrewrite.primeng.MigrateMessagesToMessageLoopArtifact@openrewrite/recipes-angular

Rewrites <p-messages [value]="expr">…</p-messages> to @for (msg of expr; track msg) { <p-message [severity]="msg.severity" [text]="msg.detail"></p-message> }. The Messages component was removed in PrimeNG 18 in favor of looping over the new Message component. Each rewritten site is recorded in the ManualMigrationSteps data table for follow-up review.

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.primeng.MigrateMessagesToMessageLoop

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

mod config recipes npm install @openrewrite/recipes-angular