lundi 18 mars 2019

Angular generate random elem id inside ngFor

i need generate a random id for each element of a ngFor (i cant use the index but is repeated ) I tried this:

(change)="edit(i+'b'+contin)" [attr.id]="i+'b'+contin"

changing the char "b" to a different letter in every ng for (8 ngFor in the same table) but the "a0" "b0" are repeated. Thanks




Aucun commentaire:

Enregistrer un commentaire