From 5f629e16c1f988d566348ff80b4725f083a0bca6 Mon Sep 17 00:00:00 2001 From: PrashantP25 <49611236+PrashantP25@users.noreply.github.com> Date: Sun, 14 Apr 2019 18:38:52 +0530 Subject: [PATCH] Update validation-service.js file resolved radio button required field validation when validation are added via addValidator method --- src/validation-service.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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