Created
August 13, 2013 02:09
-
-
Save victorjspinto/6217210 to your computer and use it in GitHub Desktop.
Evita problemas de $scope.$apply
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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