I have a FormGroup
with FormArray
control filled with FormGroup
instances
someForm = this.fb.group({
days: this.fb.array([
this.fb.group({
description: ['']
})
])
})
also, I have a getter for this array
get days(): FormArray {
return this.someForm.get('days') as FormArray;
}
when I'm trying to iterate through FormArray
and assign it to [formGroup]
directive, like shown in this article
<div *ngFor="let day of days.controls">
<ng-container [formGroup]="day">
...
I'm getting
error TS2740: Type 'AbstractControl' is missing the following properties from type 'FormGroup': controls, registerControl, addControl, removeControl, and 3 more.
*ngFor="let day of days.controls"
actually not work (I think that it's not allowed from Angular 9 -check when the articles are writting-) – Musician