diff --git a/src/validation-directive.js b/src/validation-directive.js index 5ff9517..3bd2dcc 100644 --- a/src/validation-directive.js +++ b/src/validation-directive.js @@ -100,7 +100,8 @@ ctrl.revalidateCalled = true; var value = ctrl.$modelValue; - if (!!elm && elm.hasOwnProperty("isValidationCancelled")) { + var formElmObj = commonObj.getFormElementByName(ctrl.$name); + if (!!formElmObj && formElmObj.hasOwnProperty("isValidationCancelled")) { // attempt to validate & run validation callback if user requested it var validationPromise = attemptToValidate(value); if(!!_validationCallback) {