patch Value in a nested form control using angular2

前端 未结 8 1387
日久生厌
日久生厌 2020-12-19 09:34

I need to set a value in a nested control in a FormBuiler and the model is the following:

this.addAccForm = this.fb.group({
      accid: [\'\', Validators.re         


        
8条回答
  •  执念已碎
    2020-12-19 10:13

    This did the trick for me:

    this.addAccForm.patchValue({'cyc': {cycid: 1234567 }});
    

提交回复
热议问题