Skip to content
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

reorder the broadcast complete event after the bar & spinner animation finishes #369

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tsanjoto
Copy link

@tsanjoto tsanjoto commented Oct 5, 2017

What issue is this PR resolving? Alternatively, please describe the bugfix/enhancement this PR aims to provide
I used the loading bar and a spinner template with grey overlay. I notice that my HTTP success/error callback ran first before the loading animation finish dismissing.

I found that your _completeAnimation only trigger when the bar finished the animation. It should wait for both bar and spinner animation finished animating and put it as complete.

Additionally
the $animate.leave, returns a promise when they are finished animating, so by putting
$animate.leave(...)
$rootScope.$broadcast(...)

would result the broadcast to run asynchronously.
it should be:
var promise = $animate.leave(...)
promise.then(function(){
$rootScope.$broadcast(...)
})

Have you provided unit tests that either prove the bugfix or cover the enhancement?
no

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.

1 participant