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

Commit

Permalink
fix: ngModel put back the hack
Browse files Browse the repository at this point in the history
  • Loading branch information
douglasduteil committed Jan 8, 2015
1 parent cffa1c2 commit 415610f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/ui-ace.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,11 @@ angular.module('ui.ace', [])
return function (e) {
var newValue = session.getValue();

if (ngModel && newValue !== ngModel.$viewValue) {
if (ngModel && newValue !== ngModel.$viewValue &&
// HACK make sure to only trigger the apply outside of the
// digest loop 'cause ACE is actually using this callback
// for any text transformation !
!scope.$$phase && !scope.$root.$$phase) {
scope.$applyAsync(function () {
ngModel.$setViewValue(newValue);
});
Expand Down

0 comments on commit 415610f

Please sign in to comment.