Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Validations of the input
Message
 
 
À
07/09/2017 13:38:53
Information générale
Forum:
AngularJS
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01653867
Message ID:
01654096
Vues:
41
>>>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform