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

fix(ngAnimate): remove prepare classes with multiple structural anima… #16681

Merged
merged 2 commits into from
Sep 6, 2018

Conversation

Narretz
Copy link
Contributor

@Narretz Narretz commented Sep 3, 2018

…tions

Closes #16677

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

What is the current behavior? (You can also link to an open issue here)

What is the new behavior (if this is a feature change)?

Does this PR introduce a breaking change?

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Fix/Feature: Docs have been added/updated
  • Fix/Feature: Tests have been added; existing tests pass

Other information:

extraClasses = (extraClasses ? (extraClasses + ' ') : '') + NG_ANIMATE_CLASSNAME;
var cacheKey = $$animateCache.cacheKey(node, event, extraClasses, options.removeClass);
var cacheKey = $$animateCache.cacheKey(element[0], animationEntry.event, extraClasses, options.removeClass);
Copy link
Member

Choose a reason for hiding this comment

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

AFAICT, element could also be a DOM node (in which case element[0] will be undefined), no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As far as I can see, at this point it's already normalized to be a DOM node

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, looking at it again, it seems that element is treated as a jqLite/jQuery element. So, it's fine.

module('ngAnimateMock');
inject(function($animate, $compile, $rootScope, $rootElement, $document, $$animateCache) {
element = jqLite(
// Class animation pn parent element is neeeded so the child elements get the prepare class
Copy link
Member

Choose a reason for hiding this comment

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

pn --> on (?)


$compile(element)($rootScope);
// $rootScope.cond = false;
// $rootScope.$digest();
Copy link
Member

Choose a reason for hiding this comment

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

cough, cough

@Narretz Narretz merged commit 44cc823 into angular:master Sep 6, 2018
mgol pushed a commit to mgol/angular.js that referenced this pull request Sep 6, 2018
@swuttich
Copy link

Sorry for answering late (had a week off). Thanks for refining and merging this issue @Narretz.

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.

4 participants