As you see the code below, this is a normal example. As seen TrackBy accepts as a function (what do you call that? predicate?)
then probably I can just immediately invoke a function like the example below in one line but I haven't seen that example. How can I make trackby using one line in html
and what's the best practice of using trackBy? it's always best recommended using trackBy in every loop?
<table cdk-table [dataSource]="dataSource" [trackBy]="myTrackById">
myTrackById(index: number, item: any){
return item.id;
}
<table cdk-table [dataSource]="dataSource" [trackBy]="(index, item)=>item.id">