Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

Commit de4d1c6

Browse files
committed
Merge pull request #87 from angular-ui/fix-ngModel-put-back-the-hack
fix: ngModel put back the hack
2 parents cffa1c2 + 415610f commit de4d1c6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/ui-ace.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,11 @@ angular.module('ui.ace', [])
222222
return function (e) {
223223
var newValue = session.getValue();
224224

225-
if (ngModel && newValue !== ngModel.$viewValue) {
225+
if (ngModel && newValue !== ngModel.$viewValue &&
226+
// HACK make sure to only trigger the apply outside of the
227+
// digest loop 'cause ACE is actually using this callback
228+
// for any text transformation !
229+
!scope.$$phase && !scope.$root.$$phase) {
226230
scope.$applyAsync(function () {
227231
ngModel.$setViewValue(newValue);
228232
});

0 commit comments

Comments
 (0)