Skip to content

Commit

Permalink
Add scope apply in blur callback
Browse files Browse the repository at this point in the history
  • Loading branch information
zack9433 committed May 13, 2014
1 parent 964c577 commit ea4fc94
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 3 additions & 1 deletion dist/angular-validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,9 @@
if (attrs.validMethod === 'blur') {
element.bind('blur', function () {
var value = element[0].value;
checkValidation(scope, element, attrs, ctrl, validation, value);
scope.$apply(function() {
checkValidation(scope, element, attrs, ctrl, validation, value);
});
});

return;
Expand Down
2 changes: 1 addition & 1 deletion dist/angular-validation.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions src/directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,9 @@
if (attrs.validMethod === 'blur') {
element.bind('blur', function () {
var value = element[0].value;
checkValidation(scope, element, attrs, ctrl, validation, value);
scope.$apply(function() {
checkValidation(scope, element, attrs, ctrl, validation, value);
});
});

return;
Expand Down Expand Up @@ -266,4 +268,4 @@
}
};
}]);
}).call(this);
}).call(this);

0 comments on commit ea4fc94

Please sign in to comment.