Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Angular 1.4, ngAnimate 1.4 and ui-router… #1893

Closed
hadrienl opened this issue Apr 19, 2015 · 24 comments
Closed

Angular 1.4, ngAnimate 1.4 and ui-router… #1893

hadrienl opened this issue Apr 19, 2015 · 24 comments

Comments

@hadrienl
Copy link

…doesn't work… I have en error from angular-animate : "Cannot read property '' of undefined"
Downgrade to 1.3 and everything works fine.

@nateabele
Copy link
Contributor

Okay. Please post a plunkr with your setup and I'll take a look. Thanks for the report.

@ben-hart
Copy link

+1 - I am also experiencing issues with the same versions: (1.4.0-rc.0) Angular 1.4 + ngAnimate 1.4 + ui-router 0.2.13.

@Rush
Copy link

Rush commented Apr 24, 2015

I am not getting any errors but my state animations stopped working with Angular 1.4 + ui-router.

@levbrie
Copy link

levbrie commented Apr 24, 2015

+1

@nateabele
Copy link
Contributor

Okay, if anybody wants to set up a plunkr, I'll take a look and see if I can debug it.

@levbrie
Copy link

levbrie commented Apr 24, 2015

I just set up a plunkr with 1.4.0-rc.1 and it seemed to be working fine, so I updated to 1.4.0-rc.1 in my own code base and that seemed to fix the issue there as well:

http://plnkr.co/edit/gRkr78?p=preview

@nateabele
Copy link
Contributor

Nice. Can other people confirm the same?

@Rush
Copy link

Rush commented Apr 24, 2015

Yes, rc1 fixed it for me!

@levbrie
Copy link

levbrie commented Apr 24, 2015

Just as a sidenote, the actual animating of the photos in my plunkr doesn't work as expected, either in the ui-router version I provided (http://plnkr.co/edit/gRkr78?p=preview) or in the ngRoute version I based it off of (http://plnkr.co/edit/OF2snm?p=info), which was meant to be an exact copy of http://slides.yearofmoo.com/ng-conf-2015/demos/anchor-views/index.html, which Matias presented at ng-conf. So either something changed in the new release or I'm missing something in the code. Any suggestions would be much appreciated (the transition between pages works, but the chosen photo does not animate as it should).

@ben-hart
Copy link

rc.1 did not fix my routing issues. I have an app working perfectly fine in 1.4.0-rc.1 with latest ui-router w/o ngAnimate loaded. Adding ngAnimate (same for both rc.0 or rc.1) eventually causes issues with routing. At first everything works fine, then after running through an inconsistent number of routes (different each reload), routing will suddenly stop working - url bar shows changing locations but pages do not load. no errors shown.

@nateabele
Copy link
Contributor

So either something changed in the new release

Probably that.

@neaped
Copy link

neaped commented Apr 26, 2015

angular 1.4.rc.1 doenst fix my routing as well.

In my side, the console give following error:

TypeError: Cannot read property 'end' of undefined
    at angular-animate.js:2207
    at forEach (angular.js:332)
    at closeChildAnimations (angular-animate.js:2202)
    at queueAnimation (angular-animate.js:2048)
    at Object.$$AnimateQueueProvider.$get.push (angular-animate.js:1943)
    at Object.$AnimateProvider.$get.leave (angular.js:5126)
    at Object.leave (angular-ui-router.js:3859)
    at cleanupLastView (angular-ui-router.js:3910)
    at angular-ui-router.js:3938
    at publicLinkFn (angular.js:7308)

Dig into the source code in ngAnimate 1.4, it refactor the leave function, so the getRenderer function within ui-router should be modify (am i right?)

Further more, look into the html page, the previous DOM element didn't remove correctly, but the ui-router will keep add a new DOM element on it.

screen shot 2015-04-27 at 12 03 20 am

Any idea?

@nateabele
Copy link
Contributor

@neaped If you patched it locally, paste your diff here and I'll check it out.

@neaped
Copy link

neaped commented Apr 28, 2015

@nateabele In ngAnimate 1.4.0 rc1 Line 2202

 switch (state) {
          case RUNNING_STATE:
                console.log('break')
            //animationDetails.runner.end();

I just remove the line 2205, the problem became solved. It didn't look like the problem with the new leave function. Look back on line 2201

var animationDetails = activeAnimationsLookup.get(child);

the activeAnimationsLookup is came from $$HashMap Service in line 1825

var activeAnimationsLookup = new $$HashMap();

But dig into angular's (1.4 rc1) source code, I am not able to trace the problem further more, any idea how I can keep tracing this problem? I'm still a newbie xD

@nateabele
Copy link
Contributor

@neaped Ah, I misunderstood. I thought you patched UI-Router. Anyway, I think this might be related to another bug (don't have the # handy right now), but I'll try patching it later today and pushing a new point release, and we'll see if it addresses this as well.

@neaped
Copy link

neaped commented Apr 28, 2015

@nateabele Not misunderstood, just my fault. Coz I was trying to patch UI-Router, but at the end, I make it work by patched the ngAnimate xD

I wasn't really sure whether it's a bug or just something wrong with the refactored function. In addition, I just don't know where/how to trace the problem further.

@shprink
Copy link

shprink commented May 5, 2015

I had the same problem because angular-animate was @1.3.15. Upgraded it to 1.4.0.rc-1 and it works fine. It is not a ui router issue.

@pisaacs
Copy link

pisaacs commented May 5, 2015

+1 with 1.4 rc1... just upgraded and ran into the same issue.

TypeError: Cannot read property 'end' of undefined
    at angular-animate.js:2204
    at n (angular.js:332)
    at H (angular-animate.js:2199)
    at L (angular-animate.js:2044)
    at Object.t.module.directive.factory.factory.provider.$get.push (angular-animate.js:1939)
    at Object.Me.$get.leave (angular.js:5126)
    at Object.leave (angular-ui-router.js?body=1:3860)
    at cleanupLastView (angular-ui-router.js?body=1:3911)
    at angular-ui-router.js?body=1:3939
    at angular.js:7308

@pisaacs
Copy link

pisaacs commented May 5, 2015

1.4.0-beta.6 works. However, the next version 1.4.0 rc0 doesn't work, and there are breaking changes with $animate. See https://github.com/angular/angular.js/blob/master/CHANGELOG.md for more details

@MikaAK
Copy link

MikaAK commented May 5, 2015

@pisaacs This is a known issue with angular 1.4. There is a PR open with a fix
See here

@zakhenry
Copy link

The issue @MikaAK referenced above has been closed and is now in 1.4.0 angular/angular.js#11760

@nateabele
Copy link
Contributor

So, we can close this?

@MikaAK
Copy link

MikaAK commented Jun 12, 2015

Yes this can be closed!

@samypr100
Copy link

I'm still experiencing a similar issue. See angular/angular.js#13215

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests