Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Fix issue "$apply in progress....." #3943

Closed
wants to merge 1 commit into from

Conversation

andy-maca
Copy link

Sometime cause error: $apply already in progress.

@wesleycho
Copy link
Contributor

Explain your situation in detail as to why this is necessary. On its face, this looks like a potentially dangerous fix that will prevent proper garbage collection of the element.

@andy-maca
Copy link
Author

This issue only happen in case some other operation trigger the $rootScope.$apply at the same time when move out a popover directive, I can only reproduce this issue by fast clicking some buttons with 'ng-click'.

@wesleycho
Copy link
Contributor

In this case, I think a safer fix would be to do

$timeout(function() {
  hide();
});

There is a garbage collection danger in your approach that would not properly GC the tooltip due to the possibility that the hide function never gets run.

@wesleycho wesleycho added this to the Backlog milestone Jul 17, 2015
@andy-maca
Copy link
Author

Right, this would be better.

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

Successfully merging this pull request may close these issues.

2 participants