I currently have an array of objects structured like this...
this.survey = [
{id: 1, answer: ""},
{id: 2, answer: ""},
{id: 3, answer: ""},
{id: 4, answer: ""},
{id: 5, answer: ""},
{id: 6, answer: ""},
{id: 7, answer: ""},
{id: 8, answer: ""},
{id: 9, answer: ""},
{id: 10, answer: ""},
{id: 11, answer: ""},
{id: 12, answer: ""},
{id: 13, answer: ""},
{id: 14, answer: ""},
{id: 15, answer: ""},
{id: 16, answer: ""},
{id: 17, answer: ""},
{id: 18, answer: ""},
{id: 19, answer: ""},
{id: 100, answer: ""},
{id: 101, answer: ""}
];
My question pertains to how I can precisely bind to the object where the value of id is equal to 101 with a text area input?
<textarea name="comments" class="form-control" (change)="updateSurvey($event, 101)"
[(ngModel)]="survey.?????"></textarea>
I understand that typically it's done by knowing the index position, but in this scenario, I am unable to reliably rely on that method. So, how can I directly bind to the object where id equals 101 instead of using [(ngModel)]="survey[21]"?
Thank you.