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

Commit 804e750

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 ebc3b7b commit 804e750

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
@@ -1646,7 +1646,7 @@ is set to `true`. The parse error is stored in `ngModel.$error.parse`.
16461646
16471647
// Listen for change events to enable binding
16481648
element.on('blur keyup change', function() {
1649-
scope.$apply(read);
1649+
scope.$evalAsync(read);
16501650
});
16511651
read(); // initialize
16521652

0 commit comments

Comments
 (0)