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

docs(ngModel.NgModelController): use $evalAsync instead of $apply for events #9891

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
  • Loading branch information
alexanderchan committed Nov 3, 2014
commit b39f49c72e3ea81c4ee01eb259d54fb29a9acf00
2 changes: 1 addition & 1 deletion src/ng/directive/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -1643,7 +1643,7 @@ var VALID_CLASS = 'ng-valid',

// Listen for change events to enable binding
element.on('blur keyup change', function() {
scope.$apply(read);
scope.$evalAsync(read);
});
read(); // initialize

Expand Down