I am developing an Angular 4 application and want to display a column only if totalYears <= 7. I have a ngFor and ngIf in the th element. I am currently getting an error. How do I handle it?
<table class="table">
<thead>
<tr>
<th></th>
<!-- <ng-container *ngIf="yearList.length > 6"> -->
<th *ngIf="totalYears <=7" *ngFor="let year of yearList"> {{year}}</th>
<!-- </ng-container> -->
<th>Remaining Years</th>
</tr>
</thead>
</table>