I have the following repeat structure:
TS
resposta: string[];
HTML:
<ion-card *ngFor="let pergunta of perguntas; let i = index">
I have a ngModel that I need to print the value of it in its value:
<ion-textarea name="resposta" [(ngModel)]="resposta[i]" value="{{resposta}}" placeholder="Resposta" clearInput></ion-textarea>
But I get:
Can not read property '0' of undefined
If I do: [(ngModel)]="response" all happens fine, but my other elements also get the value I put in that field.