简体   繁体   English

angular v15 更新后如何处理遗留问题

[英]What to do with legacy after angular v15 update

I did update my app from v14 to v15 .我确实将我的应用程序从v14更新到v15

In the update, I can see that angular did change在更新中,我可以看到 angular 确实发生了变化

// From
import { MatDialog } from '@angular/material/dialog'

// To
import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'

Does somebody knows the reason why?有人知道原因吗?
I search over on their website but couldn't find anything useful.我在他们的网站上搜索但找不到任何有用的东西。

Shall I just set this back to the value it was before?我可以将其设置回之前的值吗?

Basically, legacy is the older, deprecated logic that we use to have.基本上, legacy是我们过去拥有的较旧的、已弃用的逻辑。

Angular did change them so that we can migrate them one at the time. Angular 确实更改了它们,以便我们可以一次迁移它们。

To see the list of changed item, look at the following github page .要查看已更改项目的列表,请查看以下github 页面

So this is safe to let it as import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog' and refactor the page one at the time.因此,可以安全地将其作为import { MatLegacyDialog as MatDialog } from '@angular/material/legacy-dialog'并在当时重构第一页。

They also do have added a [migration script](ng generate @angular/material:mdc-migration), so running ng generate @angular/material:mdc-migration will help you in doing it.他们也添加了一个[迁移脚本](ng generate @angular/material:mdc-migration),所以运行ng generate @angular/material:mdc-migration将帮助你完成它。

I do assume this will be removed at the v16 , so better do it before我确实假设这将在v16中被删除,所以最好在之前做

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM