跳到正文
本页尚未翻译成中文,以下为英文原文。 查看英文版

Migration to self-closing tags ​

Self-closing tags are supported in Angular templates since v16. .

This schematic migrates the templates in your application to use self-closing tags.

Run the schematic using the following command:

shell
ng generate @angular/core:self-closing-tag

Before ​

html
<hello-world></hello-world>

After ​

html
<hello-world />

基于 MIT 许可证发布。