-
Notifications
You must be signed in to change notification settings - Fork 27.1k
Description
I'm submitting a...
[ ] Feature request
Current behavior
When i apply multiple custom validators directives on template driven forms input, i can not control the ordering of executing the validators.
For example:
"input type="number" ngModel requiredValidator onlyNumberValidator moreThanTenValidator "
I assumed that directives should never rely on priority:
https://stackoverflow.com/questions/35756253/controlling-order-of-directive-evaluation-in-angular-2
"Component directives may not use the following attributes:
priority and terminal. While Angular 1 components may use these, they are not used in Angular 2 and it is better not to write code that relies on them."
Expected behavior
Validators should execute in the same orders they declared on the DOM which means the requiredValidator should be the first executed one then the onlyNumberValidator and moreThanTenValidator.