Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/angular-validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ angular.module('angularValidator').directive('angularValidator', ['$injector', '


// Only add validation messages if the form field is $dirty or the form has been submitted
if (scopeElementModel.$dirty || (scope[element.form.name] && scope[element.form.name].submitted)) {
if (scopeElementModel.$dirty || scopeForm.submitted) {

if (scopeElementModel.$error.required) {
// If there is a custom required message display it
Expand Down Expand Up @@ -272,7 +272,7 @@ angular.module('angularValidator').directive('angularValidator', ['$injector', '


// Only add/remove validation classes if the field is $dirty or the form has been submitted
if (formField.$dirty || (scopeForm.submitted)) {
if (formField.$dirty || scopeForm.submitted) {
if (formField.$invalid) {
angular.element(element.parentNode).addClass('has-error');

Expand All @@ -286,4 +286,4 @@ angular.module('angularValidator').directive('angularValidator', ['$injector', '
}
};
}
]);
]);