Answer by Ciul for AngularJS : Prevent error $digest already in progress when...
I had the same problem with third parties scripts like CodeMirror for example and Krpano, and even using safeApply methods mentioned here haven't solved the error for me. But what do has solved it is...
View ArticleAnswer by teleclimber for AngularJS : Prevent error $digest already in...
I have been able to solve this problem by calling $eval instead of $apply in places where I know that the $digest function will be running. According to the docs, $apply basically does this: function...
View ArticleAnswer by frosty for AngularJS : Prevent error $digest already in progress...
The digest cycle is a synchronous call. It won't yield control to the browser's event loop until it is done. There are a few ways to deal with this. The easiest way to deal with this is to use the...
View ArticleAnswer by lambinator for AngularJS : Prevent error $digest already in...
Handy little helper method to keep this process DRY: function safeApply(scope, fn) { (scope.$$phase || scope.$root.$$phase) ? fn() : scope.$apply(fn); }
View ArticleAnswer by bullgare for AngularJS : Prevent error $digest already in progress...
Sometimes you will still get errors if you use this way (https://stackoverflow.com/a/12859093/801426). Try this: if(! $rootScope.$root.$$phase) { ...
View ArticleAnswer by Lee for AngularJS : Prevent error $digest already in progress when...
Don't use this pattern - This will end up causing more errors than it solves. Even though you think it fixed something, it didn't. You can check if a $digest is already in progress by checking...
View ArticleAnswer by dnc253 for AngularJS : Prevent error $digest already in progress...
When you get this error, it basically means that it's already in the process of updating your view. You really shouldn't need to call $apply() within your controller. If your view isn't updating as you...
View ArticleAngularJS : Prevent error $digest already in progress when calling...
I'm finding that I need to update my page to my scope manually more and more since building an application in angular. The only way I know of to do this is to call $apply() from the scope of my...
View ArticleAnswer by Sergey Sahakyan for AngularJS : Prevent error $digest already in...
let $timeoutPromise = null; $timeout.cancel($timeoutPromise); $timeoutPromise = $timeout(() => { $scope.$digest(); }, 0, false);Here is good solution to avoid this error and avoid $applyyou can...
View Article