Wednesday, 15 August 2012

angularjs - How to let angular $asyncValidator fire on blur but normal validators on input -


Is it possible that angular 1.3 $ asyncValidators not only in the form of blurring and user input? I want $ validators to behave according to the default.

I know that I can use ng-model-options to update the model on bluetooth, but then all assumptions are removed at blurring. / P>

There is currently no mechanism (angular version 1.3) to do this.

In the end, I added the Blur Event to set the Valuators to fire and then set the validity

  element.on ('blur', function () {if (ngmodel. Dirty) {doServerSideValidation ();} and {ngModel. $ SetValidity (key, true);}});  

will do the validity of ngModel after requesting the doServerSideValidation () function.


No comments:

Post a Comment