We would like to consume child reactive form data from parent when we click on parent button. Currently we are using viewchild for getting the child cpomponent reference. We
If use a "referenceVariable" you has access to all the public variables and function of the "child"
click(mychild.any)
{
console.log(mychild.detailsForm);
}
Anyway, I think you want a child that belong to a Form. For this you can use viewProviders in child
viewProviders: [
{
provide: ControlContainer,
useExisting: FormGroupDirective
}
]
As this link show