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

前端 未结 4 544
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-15 04:14

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

4条回答
  •  生来不讨喜
    2020-12-15 04:51

    below code is working

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

提交回复
热议问题