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

Commit 5f5ee0f

Browse files
noynirgkalpak
authored andcommitted
docs(forms): remove redundant call to $scope.$apply()
As of Angular 1.3 `$setViewValue` already calls `$apply` and triggers a digest cycle, so now there is no need wrapping the `$setViewValue` function call with `$apply`, which will just trigger an additional digest cycle.
1 parent 46b7cf7 commit 5f5ee0f

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

docs/content/guide/forms.ngdoc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -491,9 +491,7 @@ The following example shows how to add two-way data-binding to contentEditable e
491491
link: function(scope, elm, attrs, ctrl) {
492492
// view -> model
493493
elm.on('blur', function() {
494-
scope.$apply(function() {
495494
ctrl.$setViewValue(elm.html());
496-
});
497495
});
498496

499497
// model -> view

0 commit comments

Comments
 (0)