注释掉html模板中的单个指令或属性
在本例中,是否有方法注释掉带有注释掉html模板中的单个指令或属性,html,angular,comments,angular-template,Html,Angular,Comments,Angular Template,在本例中,是否有方法注释掉带有*ngIf,(打开),[扩展]的行 <mat-expansion-panel *ngIf="block" (opened)="panelOpened.emit()" [expanded]=expanded > 在发布我的问题之前,我已经阅读了。有一个简单html属性的解决方案,但它在Angular中不起作用 看起来添加数据-是最简单的解决方案。谢谢你的建议: <mat-ex
*ngIf
,(打开)
,[扩展]
的行
<mat-expansion-panel
*ngIf="block"
(opened)="panelOpened.emit()"
[expanded]=expanded
>
在发布我的问题之前,我已经阅读了。有一个简单html属性的解决方案,但它在Angular中不起作用 看起来添加
数据-
是最简单的解决方案。谢谢你的建议:
<mat-expansion-panel
data-ngIf="block"
data-(opened)="panelOpened.emit()"
data-[expanded]=expanded
>
将属性重命名为数据ngIf
,打开的数据
和扩展的数据
,Angula应该忽略它们。我通常会将它们移出html标记和注释them@Reactgular谢谢你的主意。它甚至可以与括号配合使用:data-[expanded]