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

ngAnimate not preserving classes in nested directives with 'replace' set to true #3940

@sbaldwin621

Description

@sbaldwin621

Decided to try updating to Angular 1.2rc2 so that I could try out the new ngAnimate. However, just including the module in my app broke a bunch of my styling.

Turns out that some of my elements were now missing their classes. These were all transcluded elements with directives with 'replace' set to true. Normally, those classes are preserved and copied onto the new element. With ngAnimate included, they go missing.

Here's a reduction of the problem: http://plnkr.co/edit/H2vUyI?p=preview

I've tracked down the problem to the following lines in animate.js:

        if ((parent.inheritedData(NG_ANIMATE_STATE) || disabledAnimation).running) {
          //avoid calling done() since there is no need to remove any
          //data or className values since this happens earlier than that
          //and also use a timeout so that it won't be asynchronous
          $timeout(onComplete || noop, 0, false);
          return;
        }

Seems like this was changed from a synchronous call to using $timeout as part of this changeset:
e31104f

Changing it back solves my problem, but as I'm unsure why the change was made in the first place, I could be missing something.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions