Reactive Forms: How to add new FormGroup or FormArray into an existing FormGroup at a later point in time in Angular till v14

FormGroup addControl method accepts AbstractControl as parameter which can be either a FormControl or a FormArray or another FormGroup as they all extend AbstractControl. class FormGroup extends AbstractControl {} class FormControl extends AbstractControl {} class FormArray extends AbstractControl {} FormBuilder can help you building such controls with array() and group() methods: this.myForm = this.fb.group({ id: … Read more