Andriy Lozynskiy
Andriy Lozynskiy

Reputation: 2604

Comment out a single directive or property in Angular html template

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.

Upvotes: 3

Views: 1730

Answers (1)

Andriy Lozynskiy
Andriy Lozynskiy

Reputation: 2604

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
    >

Upvotes: 4

Related Questions