Skip to content

Commit

Permalink
Merge pull request #77 from andersonrocha/AndersonRocha-patch-1
Browse files Browse the repository at this point in the history
Fixed issue form name work with dot
  • Loading branch information
Jakobovski authored Aug 17, 2016
2 parents ff55d22 + 020ff80 commit 9b1b176
Showing 1 changed file with 3 additions and 3 deletions.
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', '
}
};
}
]);
]);

0 comments on commit 9b1b176

Please sign in to comment.