Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

$animate.flush() does not flush $animateCss animations in queue #13005

Closed
wesleycho opened this issue Oct 3, 2015 · 3 comments · Fixed by #13707
Closed

$animate.flush() does not flush $animateCss animations in queue #13005

wesleycho opened this issue Oct 3, 2015 · 3 comments · Fixed by #13707

Comments

@wesleycho
Copy link
Contributor

We have an issue in angular-ui/bootstrap#4493 where it turns out that $animate.flush() does not flush the animations queued up by $animateCss, so the expandDone callback in the promise chain never fires in the collapse directive, which is causing some testing problems.

In particular, the .then callback in the promise returned by $animateCss(...).start() never gets called because there is no mechanism in ngMock for flushing out the queued animation.

@matsko
Copy link
Contributor

matsko commented Oct 23, 2015

I think it may be best to include a flushRunningAnimations method instead that does this plus everything that flush. We could also have another method called flushCallbacks that does this and have flush handle flushing pending animations as well as their associated callbacks.

@matsko
Copy link
Contributor

matsko commented Oct 23, 2015

@petebacondarwin and @IgorMinar what do you gentlemen you think?

@wesleycho
Copy link
Contributor Author

Should note we were able to work around it by changing to finally, but it probably is a good thing to implement a solution at some point.

@petebacondarwin petebacondarwin added this to the 1.4.9 milestone Dec 7, 2015
@Narretz Narretz self-assigned this Dec 7, 2015
matsko added a commit to matsko/angular.js that referenced this issue Dec 17, 2015
Use `$animate.closeAndFlush()` to close all running animations.

Closes angular#13005
matsko added a commit to matsko/angular.js that referenced this issue Dec 17, 2015
Use `$animate.closeAndFlush()` to close all running animations.

Closes angular#13005
matsko added a commit to matsko/angular.js that referenced this issue Dec 17, 2015
Use `$animate.closeAndFlush()` to close all running animations.

Closes angular#13005
Narretz pushed a commit to Narretz/angular.js that referenced this issue Jan 7, 2016
Use `$animate.closeAndFlush()` to close all running animations.

Closes angular#13005
Narretz pushed a commit to Narretz/angular.js that referenced this issue Jan 7, 2016
Use `$animate.closeAndFlush()` to close all running animations.

Closes angular#13005
Narretz pushed a commit to Narretz/angular.js that referenced this issue Jan 7, 2016
Use `$animate.closeAndFlush()` to close all running animations.

Closes angular#13005
Closes angular#13576
Closes angular#13707
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.