I have a scenario where I have multiple child form components included in a parent component. Each child component contains its own form group, and I need to validate all child forms when the user clicks on submit in the parent form.
How can I trigger validation for child forms from the parent component upon submission? I am using FormBuilder in each child component.
I am able to validate the child fields when the user interacts with them, but if they try to submit without entering any information or interacting with the fields, the validations are not displaying errors.
parent.component.html
<form>
<child1></child1>
<child2></child2>
<child3></child4>
<child4></child4>
''''
''''
''''
</form>
child1.component.html
<div formgroup="child1group">
<div formarray= "child1array">
....
...
...
</div>
</div
child2.component.html
<div formgroup="child2group">
<div formarray= "child2array">
....
...
...
</div>
</div
Can anyone guide me on how to implement this validation in Angular 4?