bergben / ng2-page-transition

Simple Angular2 component to create a page transition animation on route changes
MIT License
41 stars 7 forks source link

Angular 4.0.0 #8

Closed xogeny closed 7 years ago

xogeny commented 7 years ago

It seems that with the recent release of Angular 4, this broke. As far as I can tell, this issue provides an explanation of what needs to be done. It seems that BrowserAnimationsModule from @angular/platform-browser/animations needs to be included as a dependency. This was apparently moved out of core with the Angular 4 release so the synthetic attribute @ng2ElementState is be used.

bergben commented 7 years ago

Hey there @xogeny . Thanks for reporting this, I knew about the upcoming changes with 4.0.0. I will wait for the ng-conf to hear all about it and then I think more can be done than just making it work again with 4.0.0. Compare https://github.com/bergben/ng2-page-transition/issues/6
I will rename it to ngx-page-transition or something like that, which will be compatible for 4.x

FastAndFluid commented 7 years ago

I have applied the update to import BrowserAnimationsModule but the current code tries to import AnimationEntryMetadata which unlike state, trigger etc is NOT in BrowserAnimationsModule and therefore causes transpilation errors. :-S

Changed the references to type AnimationEntryMetadata to "any" (ugh!) and things are now working as they were in v2 after importing the BrowserAnimationsModule

bergben commented 7 years ago

Alright guys looks like Angular 4.1 will support route animations finally! The Angular 4.1 beta.0 is out already so I don't think it makes sense to rebuild this module for Angular 4.0 Check out the talk of Matias at the ng-conf: https://www.youtube.com/watch?v=Oh9wj-1p2BM&t=12m20s