not sure if it makes a difference, but i have an array of form controls, and then i also have an array of objects and i need to reference them both in a mat table row.
i have a "criteria" object that has some descriptions and etc, and then i have 2 form controls, which is a text field and a checkbox. i've tried using criteria[i].field
, i've tried merging the arrays (using a map function like this:
this.criteriaMapped = criteria.map((criterion, i) => {
return {
...criterion,
...this.criteriaForms.controls[i]
}
})
and i've tried a few other things, but i always get the same error
is it just me or in mat-table row/cell, is there no way to access another array? i.e.
<mat-cell *matCellDef="let criterion; let i = index" [formGroupName]="i" [innerText]="criteria[i].questionNumber"></mat-cell>
and
<mat-cell *matCellDef="let criterion; let i = index" [formGroupName]="i">
<mat-checkbox formControl="criterion.get('correct')"><span class="sr-only">Correct (yes/no)</span></mat-checkbox>
</mat-cell>
elements
please ping me in the issue and I’ll add it.
myFormArray.reset()
to myFormArray.clear()