0
votes
    this.parentForm = this._fb.group({
     testControl1: [],
     testControl2: [],
     testChildForm1: this._fb.group({
       testChildControl1: [],
       testChildControl2: []
     })
   )};

For the above parent form it contains two form controls and one nested child form group.

I would like to access the values of child form like below

this.parentForm.controls['testChildForm1'].controls.testChildControl1

But not able to access the child form's control since TS gives a error Property 'controls' does not exist on type 'AbstractControl'

1

1 Answers

0
votes

How about something like this:

this.parentForm.get(`testChildForm1.testChildControl1`).value