Skip to content
This repository was archived by the owner on Jul 6, 2022. It is now read-only.

Conversation

@bodinaren
Copy link

Use $rootScope.$$phase to make sure a digest is not already in progress before running $rootScope.$digest(). Not doing so can result a Error: $digest already in progress.

@hamchapman
Copy link
Contributor

Number 2 on the angular anti-pattern list is about this https://github.com/angular/angular.js/wiki/Anti-Patterns

I do sympathise with the problem though, i.e. getting the $digest already in progress error, however, I'm hesitant to add the phase check. I feel like there must be a better option and one that might involve restructuring the whole library, but currently I don't have time to dig into it too much.

@hamchapman
Copy link
Contributor

Closing this as currently it's not something I'm comfortable merging

@hamchapman hamchapman closed this Aug 6, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants