addControl()方法,用于在FormGroup中添加控件。是否可以将FormArray添加到现有的FormGroup中?

时间:2018-09-20 16:29:03

标签: angular

const group = this.fb.group({});
this.fb.array([this.createFormArray(value)]);
createFormArray(value){
    const tableGroup = this.fb.group({});
    value.forEach(control =>tableGroup.addControl(control.name, 
    this.createControl(control)));
    return tableGroup;
}

如何将formArray(this.fb.array([this.createFormArray(value)])添加到const组

0 个答案:

没有答案