I had this problem looping over an array possibly larger than 10 items. But I only had to show 10. This snippet solves this problem.

Solution

The solution is to use a slice pipe, which is built-in in the CommonModule:

<ion-item class="flex flex-row" *ngFor="let favorite of favorites| slice:0:10;" routerLink="/detail" [queryParams]="{Id: favorite.id}">
      <ion-badge >{{favorite.title}}</ion-badge>
</ion-item>

 

 

 

Saved you some valuable time?

Received 100 so far from 4 kind contributors.