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

fix(ngAnimate): class-based animations must set the addClass/removeClass class on the element #11853

Closed
wants to merge 1 commit into from

Conversation

matsko
Copy link
Contributor

@matsko matsko commented May 11, 2015

With the abstraction system that ngAnimate uses, $animateCss internally
sets the provided event as a CSS class on the element. In this
situation the addClass and removeClass events on the element as a
CSS class. This should not happen with class-based animations and this
feature is unnecessary and has now been removed.

Closes #11810

@@ -103,6 +103,14 @@ describe("ngAnimate $$animateCssDriver", function() {
driver({ element: element });
expect(capturedAnimation[1].applyClassesEarly).toBeFalsy();
}));

it("should not provide a method into the $animateCss animation if the animation is not structural", inject(function() {
Copy link
Contributor

Choose a reason for hiding this comment

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

"provide ... into" doesn't sound right somehow.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it should not provide a method as an option value if the animation is not structural

…ass class on the element

With the abstraction system that ngAnimate uses, $animateCss internally
sets the provided `event` as a CSS class on the element. In this
situation the `addClass` and `removeClass` events on the element as a
CSS class. This should not happen with class-based animations and this
feature is unnecessary and has now been removed.

Closes angular#11810
@matsko matsko force-pushed the fix_add_class_method_name branch from 20b509d to 5f0f82d Compare May 20, 2015 03:58
@@ -104,6 +104,14 @@ describe("ngAnimate $$animateCssDriver", function() {
driver({ element: element });
expect(capturedAnimation[1].applyClassesEarly).toBeFalsy();
}));

it("should not provide a `method` as an option value if the animation is not structural", inject(function() {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we could simplify this by changing it "should only provide ... if the animation is structural". What still confuses me, is that "method" doesn't really reflect what is set. It's really the event (name) that is set, right?

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with @Narretz here. Let's change this to:

it("should only set the event name if the animation is structural", inject(function() {

Also the previous it clause should probably change:

it("should signal $animateCss to apply the classes early when animation is structural", inject(function() {

@petebacondarwin
Copy link
Contributor

I think the commit message ought to be

fix(ngAnimate): class-based animations must not set addClass/removeClass CSS classes on the element

@petebacondarwin
Copy link
Contributor

Apart from tweaks to test descriptions this LGTM

@matsko
Copy link
Contributor Author

matsko commented May 21, 2015

Fixed up and merged as 3a3db69

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

ngAnimate: the addClass/removeClass class is added during the animation
4 participants