Skip to content

Commit 9b1b176

Browse files
authored
Merge pull request Jakobovski#77 from andersonrocha/AndersonRocha-patch-1
Fixed issue form name work with dot
2 parents ff55d22 + 020ff80 commit 9b1b176

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/angular-validator.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ angular.module('angularValidator').directive('angularValidator', ['$injector', '
209209

210210

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

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

273273

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

@@ -286,4 +286,4 @@ angular.module('angularValidator').directive('angularValidator', ['$injector', '
286286
}
287287
};
288288
}
289-
]);
289+
]);

0 commit comments

Comments
 (0)