Having two Angular Components, one is called parent.ts and the other is named child.ts.
Parent.ts contains a Form group, while child.ts passes the Form data via CVA to the parent.
Now, I am looking to create a reusable child component that can generate components like child1.ts, child2.ts, …
Everything has been working perfectly fine up until this point, where I have created multiple components in this manner.
The issue arises when some child components are required, whereas others are not.
When I provide Validators in the Parent component, validation works correctly as the form becomes invalid if fields are empty. However, the Child component does not receive the Validation state from parent.ts, which means it remains valid.
Consequently, the child component doesn't display the ng-error
message.
My question is: How can I pass the Validation state from the parent to the child in order to display error messages?