Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

angular

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={}-->
like image 957
Toni Mora Avatar asked Oct 31 '22 10:10

Toni Mora


1 Answers

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.

like image 77
Günter Zöchbauer Avatar answered Nov 15 '22 08:11

Günter Zöchbauer