Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Validations of the input
Message
 
 
General information
Forum:
AngularJS
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01653867
Message ID:
01654096
Views:
43
>>>Looks like this might be known behaviour. See: https://stackoverflow.com/questions/31736496/why-does-adding-additional-angularjs-validation-directives-cause-asyncvalidator
>>>and https://github.com/angular/angular.js/issues/14691
>>>
>>>As suggested earlier there may be some condition that you can check in your directive to determine whether the asyncValidator actually needs to run. If it does not then you could just short-circuit the http call
>>
>>Do you know what condition that may be? In the meantime I also asked on StackOverflow (I didn't see your message until now)
>>
>>https://stackoverflow.com/questions/46101820/do-asyncvalidators-fire-all-the-time
>
>Just guessing (since I don't know the situation) but e.g. if the control value is empty or not dirty ?
>
>Actually I'm trying to forget all I know about directives and scopes since moving to Angular2 :-}

Angular2 doesn't have directives? I need to start learning it, I started a course on Pluralsight a while ago and didn't have time to digest.

I also tried adding ngModel.$touched at the very top and then it didn't work at all. I may try comparing modelValue with viewValue and only fire if they differ.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform