Angular Custom Component Validation Behaviour

时间:2018-06-18 11:42:11

标签: angular

I'm creating some Custom Components in Angular and having some problems with validation. I've implemented ControlValueAccessor and Validator in the component and using ngModel.

My problem is that when the page is first loaded the submit button is not enabled: https://stackblitz.com/edit/angular-custom-component-validation

When I don't use Custom Components the page loads correctly with the submit button enabled: https://stackblitz.com/edit/angular-validation-without-customcomponent

I think I must be missing some initialisation in the ControlValueAccessor but it's all a bit new to me.

Thanks,

0 个答案:

没有答案