2

Is there a way to comment out lines with *ngIf, (opened), [expanded] in this example?

    <mat-expansion-panel
         *ngIf="block"
         (opened)="panelOpened.emit()"
         [expanded]=expanded
    >

I have read How to comment HTML tag attribute in HTML source code? before posting my question. There is a solution for plain html attributes, but it's not working in Angular.

Andriy Lozynskiy
  • 2,444
  • 2
  • 17
  • 35

1 Answers1

2

Looks like adding data- is the simplest solution. Thanks @Reactgular for this idea:

<mat-expansion-panel
         data-ngIf="block"
         data-(opened)="panelOpened.emit()"
         data-[expanded]=expanded
    >
Andriy Lozynskiy
  • 2,444
  • 2
  • 17
  • 35