How to append new FormGroup or FormControl to form

前端 未结 4 1144
灰色年华
灰色年华 2021-01-31 15:28

I have the following form in Angular created with FormBuilder:

constructor(private fb: FormBuilder) {
    this.myForm = fb.group({
             


        
4条回答
  •  孤街浪徒
    2021-01-31 16:12

    You can use addControl method of FormGroup class as per documentation

    So you can do as below :

    this.myForm.addControl('newcontrol',[]);
    

提交回复
热议问题