Skip to content
This repository has been archived by the owner on Jun 11, 2021. It is now read-only.

Improvements: Dynamic animations, pageTransitionService, :enter and :leave animations #6

Closed
bergben opened this issue Feb 26, 2017 · 1 comment
Assignees

Comments

@bergben
Copy link
Owner

bergben commented Feb 26, 2017

  • Deprecate ng2-page-transition and rename to ngx-animate-routes

  • Pass data in routes like

const routes: Routes = [
  {
    path: 'home',
    component: HomeComponent,
    data: {
      pageTransition: {
           goBackMotion: ['toRoute1'],
           goForwardMotion: ['toRoute2']
      }
    }
  },
[...]
]
  • Use ActivatedRoute to get page-transition data per route and trigger transition based on fromRoutes or toRoutes or trigger default transition if no matches.

  • Add service to support special use cases like

showNextFriend(someId: string):void{
     this.pageTransitionService.nextRouteDo(someTransition);
     this.router.navigate('/friend/'+someId); 
}
  • Make simple :enter and :leave transitions possible (<animated-router-outlet> ? ) -> Creates router-outlet. Wrap div around component so that it is not replaced immediately on route change and the leave transition can complete -> then remove div DOM node

  • pass in animations in forRoot

@bergben bergben self-assigned this Feb 26, 2017
@bergben bergben changed the title Allow dynamic transitions for routes Improvements: Dynamic animations, pageTransitionService, :enter and :leave animations Feb 27, 2017
@bergben
Copy link
Owner Author

bergben commented Mar 4, 2017

There is currently no possibility to do this in a clean way without accessing the DOM directly.

Not even extending the router-outlet would work unless replacing the whole thing.

See https://gitter.im/angular/angular?at=58ba0ed3872fc8ce62b2d34a and the messages up to ~ 10 hours before
See http://stackoverflow.com/questions/42583354/angular-2-router-wait-for-animation-to-complete-on-component-before-destroying-i

Upcoming changes for animations might change this situation. Probable date to know more is the ng-conf from 5th to 7th April https://www.ng-conf.org/

Closed for now.

@bergben bergben closed this as completed Mar 4, 2017
@bergben bergben mentioned this issue Mar 29, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant