Skip to content

Instantly share code, notes, and snippets.

@victorjspinto
Created August 13, 2013 02:09
Show Gist options
  • Save victorjspinto/6217210 to your computer and use it in GitHub Desktop.
Save victorjspinto/6217210 to your computer and use it in GitHub Desktop.
Evita problemas de $scope.$apply
var phase = scope.$root.$$phase;
if(phase == '$apply' || phase == '$digest') {
ngModel.$setViewValue(editor.getSession().getValue());
} else {
scope.$apply(function(){
ngModel.$setViewValue(editor.getSession().getValue());
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment