Is there any difference between binding a variable and binding a method in template *ngIf.
Ex:
Case 1:
<div *ngIf="myVar">ABC</div>
Case 2:
<div *ngIf="myFunction()">ABC</div>
myFunction() : boolean {
if (cond1 && cond2 && cond3) {
return true;
} else {
return false;
}
}
Is there any impact on performance?
I am trying to use the 2 case, getting range Error: Maximum call stack exceeds.
Help me on this? Thanks
console.count()
inside of it, and see how many times it will be called. – Arbalest