Migrate angular *ngFor and *ngIf to new v17 syntax?
Asked Answered
Z

1

9

I'm migrating from angular 16 to 17 and I encountered the issue that I need to replace all the usages of *ngFor and *ngIf and ngSwitch with the new syntax (@for and @if and @switch).

I know the v17 still supports the old syntax but is there a way to migrate them or a regex to replace them with the new form?

Zouave answered 15/11, 2023 at 17:0 Comment(0)
Z
19

You can migrate your angular project control flow with this command:

ng g @angular/core:control-flow

It will take a path and migrate the entire files (including subdirectories) to the new control flow.

This command is still in developer review but it worked fine for my project.

Zouave answered 15/11, 2023 at 17:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.