Angular2: Property ‘controls’ does not exist on type ‘AbstractControl’. Error when accessing .control of an object within a formarray thru an index

You can use ['controls'] instead of .controls, as below:

(<FormArray>this.loanTypeForm.controls['frequency']).controls[index]['controls']['settings'].push(...)

But in order to simplify and provide more readability I’d suggest you to change it all to:

const control = this.loanTypeForm.get(`frequency.${index}.settings`) as FormArray;
control.push(...);

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)