I want to iterate through the first four objects of an array. I want to use ngFor instead of selecting the first four objects like this:
{{ users[*]?.UserName }}
* being the 0-3
I want to use this:
<div *ngFor="let user of users; let i = index" [attr.data-index]="i">
{{user?.UserName}}
This works but displays all users in the array and I only need the first 4 (index 0-3). Is there a way to tell the ngFor something like: i<4?