Skip to content

Commit ea4fc94

Browse files
committed
Add scope apply in blur callback
1 parent 964c577 commit ea4fc94

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

dist/angular-validation.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,9 @@
473473
if (attrs.validMethod === 'blur') {
474474
element.bind('blur', function () {
475475
var value = element[0].value;
476-
checkValidation(scope, element, attrs, ctrl, validation, value);
476+
scope.$apply(function() {
477+
checkValidation(scope, element, attrs, ctrl, validation, value);
478+
});
477479
});
478480

479481
return;

dist/angular-validation.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/directive.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,9 @@
214214
if (attrs.validMethod === 'blur') {
215215
element.bind('blur', function () {
216216
var value = element[0].value;
217-
checkValidation(scope, element, attrs, ctrl, validation, value);
217+
scope.$apply(function() {
218+
checkValidation(scope, element, attrs, ctrl, validation, value);
219+
});
218220
});
219221

220222
return;
@@ -266,4 +268,4 @@
266268
}
267269
};
268270
}]);
269-
}).call(this);
271+
}).call(this);

0 commit comments

Comments
 (0)