rsaenen / ngx-custom-validators

Angular custom directives for validation
129 stars 53 forks source link

Possible to trigger validation check on blur and not on modal change #9

Closed VigneshVaidyanathan closed 6 years ago

VigneshVaidyanathan commented 6 years ago

Is it possible to change the validation to occur only after input blur event and not on modal change?

rsaenen commented 6 years ago

Please read the document about FormGroup: https://angular.io/api/forms/FormGroup#example-1

Since Angular 6, you can edit the updateOn value:

const c = new FormGroup({
   one: new FormControl()
}, {updateOn: 'blur'});
VigneshVaidyanathan commented 6 years ago

Thanks, is there any way to do it in Angular 4?

rsaenen commented 6 years ago

As this is a new feat, upgrade to v6 is the best option.