Error: Can't have multiple template bindings on one element.
Answers (1)
Add AnswerYou can not use two template binding on one element in Angular.
For example: If you use *ngIf in the <div> then you can not use *ngFor for the same <div> tag.
But you can achieve the same scenario by wrapping the element in other <div> or in another tag. It is good practice to use <ng-container> because it is a logical container.
<ng-container *ngIf="employee"> <div *ngFor="let emp of employee"> {{emp.name}} </div> </ng-container>