最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Migrate angular *ngFor and *ngIf to new v17 syntax? - Stack Overflow

programmeradmin7浏览0评论

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?

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?

Share Improve this question edited 2 days ago Mahdi Zarei asked Nov 15, 2023 at 17:00 Mahdi ZareiMahdi Zarei 7,4568 gold badges32 silver badges64 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 22

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

ng g @angular/core:control-flow

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

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

发布评论

评论列表(0)

  1. 暂无评论