How to display only 10 items in array


i would like to display only the 10 first item in my array but i am getting error and slow performance whenever i use ngIf=i<10 and let i=index any help i am new here n i am trying to learn


[repost for duplicate]
The correct way to do so is to use a pipe in your *ngFor directive. For instance :

<Label *ngFor="let item of itemsArray|limitTo:10" [text]="item.body"></Label>

You can find suitable documentaion here