I am attempting to complete a task where, using an ngFor directive to iterate through an array, I need to display the first 2 elements in a row and the remaining elements in a descending column. It should look like this:
first second
third
fourth
fifth
..nth
To achieve this, I tried applying ngClass to conditionally style the first two elements like so:
<div class="d-flex flex-row">
<div *ngFor="let item of array; let i = index">
<span [ngClass]="{ 'd-flex flex-column': i > 1 }">
<div>{{item}}</div>
</span>
</div>
</div>
However, this approach is not working as intended since all elements are still displayed in a row. Any suggestions on how to improve this? Thank you in advance.