From b39f49c72e3ea81c4ee01eb259d54fb29a9acf00 Mon Sep 17 00:00:00 2001 From: AlexChan Date: Mon, 3 Nov 2014 21:09:39 +0100 Subject: [PATCH] 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. --- src/ng/directive/input.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ng/directive/input.js b/src/ng/directive/input.js index 9bd6dc979ab6..40e749e07197 100644 --- a/src/ng/directive/input.js +++ b/src/ng/directive/input.js @@ -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