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

feat(ngMock): add support for $animate.closeAndFlush() #13576

Closed
wants to merge 1 commit into from

Conversation

matsko
Copy link
Contributor

@matsko matsko commented Dec 17, 2015

Use $animate.closeAndFlush() to close all running animations.

Closes #13005

Use `$animate.closeAndFlush()` to close all running animations.

Closes angular#13005
@@ -456,7 +456,7 @@ var $AnimateCssProvider = ['$animateProvider', function($animateProvider) {
var node = getDomNode(element);
if (!node
|| !node.parentNode
|| !$animate.enabled()) {
|| !$$animateQueue.enabled()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ngMock decorates the $animate service with the new closeAndFlush method. Both $animateCss and $$animateJs have their own closeAndFlush implementations so, $animate requires both services. Since $animateCss also requires $animate, this would create a circular dependency.

@Narretz Narretz added this to the 1.5.x - migration-facilitation milestone Jan 4, 2016
@Narretz Narretz self-assigned this Jan 5, 2016
@@ -63,8 +65,32 @@ var $$AnimateJsProvider = ['$animateProvider', function($animateProvider) {
applyAnimationClasses(element, options);
}

function close(success) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

success isn't used.

@gkalpak
Copy link
Member

gkalpak commented Jan 6, 2016

LGTM (other than the unused success argument).

@matsko matsko closed this in e1def1b Jan 7, 2016
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.

$animate.flush() does not flush $animateCss animations in queue
4 participants