Toni Mora
Toni Mora

Reputation: 95

Delete comments of DOM for *ngFor and *ngIf in Angularjs2

Is it possible to remove comments that makes the DOM "*ngIf" or "*ngFor" AngularJS2 when there isn't an element to render?

Maybe it's possible to set this up somewhere and not know. I would have the DOM as clean as possible and not see comments like this:

<!--template bindings={}-->

Upvotes: 5

Views: 1563

Answers (1)

G&#252;nter Z&#246;chbauer
G&#252;nter Z&#246;chbauer

Reputation: 657108

They are placeholders so Angular knows where to render elements. For example when the collection you refer to is empty and then add data Angular needs to know where to render the first template item.

Upvotes: 2

Related Questions