diff --git a/src/validation-service.js b/src/validation-service.js index d4cb8f0..fa1464f 100644 --- a/src/validation-service.js +++ b/src/validation-service.js @@ -106,7 +106,7 @@ angular self.commonObj.initialize(scope, attrs.elm, attrs, attrs.ctrl); // attempt to validate & run validation callback if user requested it - var validationPromise = attemptToValidate(self, event.target.value, 0); + var validationPromise = attemptToValidate(self, (attrs.ctrl.$modelValue == undefined ? '' : attrs.ctrl.$modelValue), 0); if(!!_validationCallback) { self.commonObj.runValidationCallbackOnPromise(validationPromise, _validationCallback); } @@ -574,7 +574,7 @@ angular attrs.elm.bind('blur', _blurHandler = function(event) { if (!!formElmObj && !formElmObj.isValidationCancelled) { // attempt to validate & run validation callback if user requested it - var validationPromise = attemptToValidate(self, event.target.value, 10); + var validationPromise = attemptToValidate(self, (attrs.ctrl.$modelValue == undefined ? '' : attrs.ctrl.$modelValue), 10); if(!!_validationCallback) { self.commonObj.runValidationCallbackOnPromise(validationPromise, _validationCallback); } @@ -596,4 +596,4 @@ angular }); } -}]); // ValidationService \ No newline at end of file +}]); // ValidationService