I\'m trying to push another formbuilder within a formarray but it gives me an error since I think there are no items in the array when initializing the code, hence there are
It seems that the loanTypeForm is treated as AbstractControl... so let's assure compiler that it is FormGroup
var group = this.loanTypeForm as FormGroup;
var array = group.controls['frequency'] as FormArray;
var control = group.controls[index]; // AbstractControl again.. could be casted as needed
and in case, that control is also group or form we just have to use assert (cast) as well
var control = group.controls[index] as FormGroup
And then we can easily continue
control.controls['settings']...