The leading asterisk
- When using leading asterisk with structural directive (ngIf, ngFor, ngSwitchCase), angular re-writes that block using ng-template
<div *ngIf="courses.length > 0 else noCourses">List of Courses</div>
<ng-template #noCourses>No courses</div>
rewritten as
<ng-template [ngIf]="courses.length > 0">
<div>List of courses</div>
</ng-template>
<ng-template [ngIf]="!(courses.length>0)">No courses</div>