Skip to content

properly detect digest in progress #185

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 26, 2017

Conversation

zacronos
Copy link
Contributor

I'm hitting the $digest already in progress error when using applyUpdates with 1.7.0-rc.2 -- this seems to fix the issue for me. I'm not sure exactly how to reproduce the issue, but I can verify the fix at least for my project.

@zacronos
Copy link
Contributor Author

This might fix #179.

@dhilt
Copy link
Member

dhilt commented Oct 25, 2017

@zacronos This is why this feature is still in release candidate. It's new and in 1.6 it was just https://github.com/angular-ui/ui-scroll/blob/v1.6.2/src/ui-scroll.js#L336. This is really important part of the component's core and I felt that something's still not okey here. I believe you suggestion is very close to the finalize it. Before accepting this PR, I'd think about writing a test. So if could think about a repro, it will help!

@zacronos
Copy link
Contributor Author

@dhilt a comment to this SO answer mentions the need for checking $$phase on both scope and root scope, and speculates that is has something to do with isolated scopes. So perhaps if ui-scroll is within the template of a directive with isolated scope, that is when we can duplicate?

If I get the time, I'll try to reproduce with that approach -- however work has gotten very busy for me so we'll see.

@dhilt dhilt merged commit efe6cac into angular-ui:master Oct 26, 2017
@dhilt
Copy link
Member

dhilt commented Oct 26, 2017

@zacronos Thanks! I'm going to merge it right now, but it needs to be further investigated.

In addition I would like to say that we already have something on that score, I mean the scroll event handler. And you don't see there a !$rootScope.$$phase protection due to it is present in the beginning of function.

@zacronos
Copy link
Contributor Author

Yep, I did see that, which is why I didn't add the additional guard in that function.

FYI, I forgot to mention that the isolated scope directive scenario I described above is actually the case in my project, so there is supporting evidence that that is when it is necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants