You can use the Slice Pipe for limit ngFor.
{{ value_expression | slice : start [ : end ] }}
<li *ngFor="let item of items | slice:0:5; let i=index>{{item.name}}</li>
You can also try this approach
<ng-container *ngFor="let item of items" let-i="index"> <li *ngIf="i<5">{{item.name}}</li> </ng-container>