This repository was archived by the owner on Jul 1, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -482,7 +482,7 @@ angular
482
482
var isSubmitted = ( ! ! attrs && attrs . isSubmitted ) ? attrs . isSubmitted : false ;
483
483
484
484
// invalid & isDirty, display the error message... if <span> not exist then create it, else udpate the <span> text
485
- if ( ! _globalOptions . hideErrorUnderInputs && ! ! attrs && ! attrs . isValid && ( isSubmitted || self . ctrl . $dirty || self . ctrl . $touched ) ) {
485
+ if ( ! _globalOptions . hideErrorUnderInputs && ! ! attrs && ! attrs . isValid && ( isSubmitted || self . ctrl . $dirty || self . ctrl . $touched || self . ctrl . revalidateCalled ) ) {
486
486
( errorElm . length > 0 ) ? errorElm . html ( errorMsg ) : elm . after ( '<div class="validation validation-' + elmInputName + ' text-danger">' + errorMsg + '</div>' ) ;
487
487
} else {
488
488
errorElm . html ( '' ) ; // element is pristine or no validation applied, error message has to be blank
Original file line number Diff line number Diff line change 87
87
88
88
// attach the onBlur event handler on the element
89
89
elm . bind ( 'blur' , blurHandler ) ;
90
+
91
+ // attach the angularValidation.revalidate event handler on the scope
92
+ scope . $on ( 'angularValidation.revalidate' , function ( event , args ) {
93
+ if ( args == ctrl . $name )
94
+ {
95
+ ctrl . revalidateCalled = true ;
96
+ var value = ctrl . $modelValue ;
97
+
98
+ if ( ! elm . isValidationCancelled ) {
99
+ // attempt to validate & run validation callback if user requested it
100
+ var validationPromise = attemptToValidate ( value ) ;
101
+ if ( ! ! _validationCallback ) {
102
+ commonObj . runValidationCallbackOnPromise ( validationPromise , _validationCallback ) ;
103
+ }
104
+ }
105
+ else {
106
+ ctrl . $setValidity ( 'validation' , true ) ;
107
+ }
108
+ }
109
+ } ) ;
90
110
91
111
//----
92
112
// Private functions declaration
You can’t perform that action at this time.
0 commit comments