Reputation: 31
I referred this link : http://tylerscode.com/2017/03/splitting-angular-forms-controlvalueaccessor/#respond
I want to validate all fields in child component with control value accessor and template driven forms.
(This is link of issues on Stackblitz: https://stackblitz.com/edit/angular-qzioet)
Upvotes: 2
Views: 3525
Reputation: 27293
ControlContainer
A base class for directives that contain multiple registered instances of NgControl. Only used by the forms module
Use viewProviders inside your child form
viewProviders: [ { provide: ControlContainer, useExisting: NgForm }]
Example:https://stackblitz.com/edit/angular-cncupd
Upvotes: 2