Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit c26b5e3

Browse files
alexanderchancaitp
authored andcommitted
docs(ngModel.NgModelController) use $evalAsync instead of $apply for event handling
Have the apply called safely during events by using `$evalAsync` rather than `$apply` This will help ensure that an apply for a user directive is not called during a digest cycle. Closes #9891
1 parent 4d0614f commit c26b5e3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ng/directive/input.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1001,7 +1001,7 @@ var VALID_CLASS = 'ng-valid',
10011001
10021002
// Listen for change events to enable binding
10031003
element.on('blur keyup change', function() {
1004-
scope.$apply(read);
1004+
scope.$evalAsync(read);
10051005
});
10061006
read(); // initialize
10071007

0 commit comments

Comments
 (0)