Using Angular 9, I'm looping through a list of data, but if a value equals primary I want to place that specific row at the top of the list or first.
I have the table working already and I'm looping using *ngFor="let item of items | sort: sortColumn: sortAscending. However, I'm struggling on the front-end to find the primary using item.primary = true and make it first in the loop, and then continue looping.
My Angular skills are limited here. I've seen the answer that unshift() will work, but I'm not sure how to code that into *ngFor.
NOTE: This is the standard <table/> table, not using <mat-table/>.
Hopefully, that makes sense. Thanks!