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

fix(ngAnimate): ensure that repeated structural calls during pre-digest function #11895

Closed
wants to merge 1 commit into from

Conversation

matsko
Copy link
Contributor

@matsko matsko commented May 18, 2015

Prior to this fix if $animate.enter() or $animate.leave() was called
before a digest was issued then the element may not be cancelled early
enough. This fix ensures that the previous structural animation is
cancelled immediately when a follow-up animation is kicked off.

Closes #11867

…st function

Prior to this fix if `$animate.enter()` or `$animate.leave()` was called
before a digest was issued then the element may not be cancelled early
enough. This fix ensures that the previous structural animation is
cancelled immediately when a follow-up animation is kicked off.

Closes angular#11867
@matsko matsko force-pushed the fix_duplicate_view_issue branch from 25c1158 to 97d266e Compare May 20, 2015 04:01
$$rAF.flush();
expect(enterComplete).toBe(true);
}));

Copy link
Contributor

Choose a reason for hiding this comment

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

Use spies:

      it('should cancel the previous structural animation if a follow-up structural animation takes over before the postDigest',
        inject(function($animate, $$rAF) {

        var enterDone = jasmine.createSpy('enter animation done');
        $animate.enter(element, parent).done(enterDone);
        expect(enterDone).not.toHaveBeenCalled();

        $animate.leave(element);
        $$rAF.flush();
        expect(enterDone).toHaveBeenCalled();
      }));

@petebacondarwin
Copy link
Contributor

Except for not using spies, LGTM

@matsko
Copy link
Contributor Author

matsko commented May 21, 2015

Landed as 2327f5a.

@matsko matsko closed this May 21, 2015
@matsko matsko deleted the fix_duplicate_view_issue branch May 21, 2015 03:34
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.

ng-view duplication in the 1.4.RC
4 participants