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

Commit

Permalink
docs(ngModel.NgModelController) use $evalAsync instead of $apply
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
alexanderchan authored and caitp committed Nov 11, 2014
1 parent ebc3b7b commit 804e750
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ng/directive/input.js
Expand Up @@ -1646,7 +1646,7 @@ is set to `true`. The parse error is stored in `ngModel.$error.parse`.
// Listen for change events to enable binding
element.on('blur keyup change', function() {
scope.$apply(read);
scope.$evalAsync(read);
});
read(); // initialize
Expand Down

0 comments on commit 804e750

Please sign in to comment.