I have a list having 100 values and i need to display first 10 values by iterating the list in angular datatable?
<tr *ngFor="let i of arr">
<td>{{i}}</td>
</tr>
I have a list having 100 values and i need to display first 10 values by iterating the list in angular datatable?
<tr *ngFor="let i of arr">
<td>{{i}}</td>
</tr>
Like Doc of Angular you can use SlicePipe
https://angular.io/api/common/SlicePipe
<tr *ngFor="let i of arr | slice:0:10">
<td>{{i}}</td>
</tr>
OR
Try this
<tr *ngFor="let i of arr.slice(0, 10)">
<td>{{i}}</td>
</tr>
Hope useful