Hello, I have a repeat structure where a pipe filter can be applied. I have read that trackBy can aid performance because it does not render the DOM unnecessarily.
I put it in my component:
trackByFn(index, item) {
return item.id; //Aplicado trackbyfn para melhorar performance do *ngFor
}
In my template:
<tr *ngFor="let calculo of calculos;let m = index; trackBy: trackByFn" class="table-line">
Am I doing it correctly? Do you have to pass some specific value to the trackby or just pass the function is enough?