How to get the child component Formgroup value in the Parent form Component in the Angular

41 views Asked by At

I have component structure like this

Parent - [formGroup]="parentForm"

ChildA - formGroupName="childAForm"

ChildB - formGroupName="childBForm" ChildB have 4 children component

  child1-**formGroupName="child1Form"**

  child2-**formGroupName="child2Form"**

  child3-**formGroupName="child3Form"**

  child4-**formGroupName="child4Form"**

childA formgroup value can be gotten from the parent form, which works fine. But getting a value for ChildB is not binding on the parent. It is empty, the values of child1, child2, child3, and child4 from control are not bound to parent.

Can anyone please suggest that this approach is possible? If yes, please update the way.

0

There are 0 answers