0
I have a pipe that performs a filter on my *ngFor
:
<input [(ngModel)]="anunciosFiltro.name" type="text" name="filtra" id="filtra">
<tr *ngFor="let anuncio of sortedData | filterBy: anunciosFiltro; let i = index">
TS:
anunciosFiltro: any = { name: '' };
It turns out that inside the *ngFor
I have an edit button that uses the index of this *ngFor
, when I filter and bring only one product, it takes the index 0, but actually the index of that product in the array sortedData
is 4.
Is there any way to get the correct index?
Managed to solve?
– Maurivan
Yes, I had an edit methodAnuncio(sortedData[i]), changed to editAnuncio(anuncio), it worked
– veroneseComS