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

$animate.enter with third parameter in 1.4.x #11848

Closed
Foxandxss opened this issue May 11, 2015 · 3 comments
Closed

$animate.enter with third parameter in 1.4.x #11848

Foxandxss opened this issue May 11, 2015 · 3 comments

Comments

@Foxandxss
Copy link
Member

I have been doing $animate.enter() for a while in Angular 1.3.x in the following way:

$animate.enter(element, parent, parent[0].lastChild);

So instead of adding a new element at the beginning of parent, I add them after the last item on parent.

That worked good, but after I updated to Angular 1.4.x, it says that what I pass as the third parameter parent[0].lastChild doesn't have the after method. That suggested to me that I needed to wrap that element into angular.element:

$animate.enter(element, parent, angular.element(parent[0].lastChild));

And that did work. The thing is, I tried to replicate this issue on a plunker and it didn't work either in 1.3.x if I don't wrap the third parameter.

So my question is: Having to wrap the third parameter with angular.element was always needed? Or maybe with the whole refactor it needs it now?

It surely fixed it to work with 1.3.x as well but it feels weird now.

There is a plunker

Maybe I am doing it wrong, but it worked for me in the past when it was just after.after.

@petebacondarwin petebacondarwin modified the milestones: 1.4.0-rc.3, 1.4.x - jaracimrman-existence May 18, 2015
@petebacondarwin
Copy link
Contributor

@matsko - can you provide an answer here?

matsko added a commit to matsko/angular.js that referenced this issue May 18, 2015
Prior to this fix the $animate.enter() and $animate.move() events caused
an error when a parent or after element was provided that was not
already wrapped as a jqLite element. This patch ensures that both
wrapped and unwrapped DOM nodes are allowed.

Closes angular#11848
@matsko
Copy link
Contributor

matsko commented May 18, 2015

This PR fixes the issue: #11894

@matsko matsko closed this as completed in f26fc26 May 18, 2015
@Foxandxss
Copy link
Member Author

Thanks @matsko for fixing it.

netman92 pushed a commit to netman92/angular.js that referenced this issue Aug 8, 2015
Prior to this fix the $animate.enter() and $animate.move() events caused
an error when a parent or after element was provided that was not
already wrapped as a jqLite element. This patch ensures that both
wrapped and unwrapped DOM nodes are allowed.

Closes angular#11848
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants