[style.height]=“600px”
. To apply multiple styles, https://angular.io/api/common/NgStyle is the current recommendation.
i'm using angular material and mat-table. i'm trying to use a form array on it, but i just keep getting errors saying it can't find the control.
if i click the response or correct fields, it loads one or 2 more but i still get spammed in the console.
here's the relevant part of the html: https://summers.codes/buzuditeba.html
and here's the typescript file (warning: it's really long):
https://summers.codes/lisugurako.ts
here's what it looks like/does https://i.imgur.com/8VueGP8.png
although this isn't mat-table, this worked before https://summers.codes/awonusuyiv.html
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()