Migrate <p-messages> to <p-message> with @for loop
Recipe ID
org.openrewrite.primeng.MigrateMessagesToMessageLoopArtifact@openrewrite/recipes-angularRewrites <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.MigrateMessagesToMessageLoopIf the recipe isn’t available locally, install it with:
mod config recipes npm install @openrewrite/recipes-angular