Skip to content
This repository was archived by the owner on Jul 1, 2020. It is now read-only.

Commit 075844e

Browse files
committed
Fix #12
Show error message on blur
1 parent 193e95c commit 075844e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/angular-validation.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@
422422
}
423423

424424
// Re-Render Error display element inside a <span class="validation validation-inputName text-danger">
425-
if(hasValidation && !isFieldValid && ctrl.$dirty) {
425+
if(hasValidation && !isFieldValid && (ctrl.$dirty || ctrl.$touched)) {
426426
// invalid & isDirty, display the error message... if <span> not exist then create it, else udpate the <span> text
427427
(errorElm.length > 0) ? errorElm.text(message) : elm.after('<span class="validation validation-'+elmInputName+' text-danger">'+message+'</span>');
428428
}else {
@@ -560,4 +560,4 @@
560560

561561
} // end of link: function()
562562
}; // end of return;
563-
}]); // end of directive
563+
}]); // end of directive

0 commit comments

Comments
 (0)