tomastrajan / angular-ngrx-material-starter

Angular, NgRx, Angular CLI & Angular Material Starter Project
https://tomastrajan.github.io/angular-ngrx-material-starter
MIT License
2.82k stars 918 forks source link

Route transition animation do not work when navigating between lazy loaded modules #457

Closed alexkolt closed 5 years ago

alexkolt commented 5 years ago

Animation trigger is firing based on relative loaded path("home", "dashboard", etc). Paths for lazy loaded modules are going to be blank "" as the path inside the lazy module is considered, not the one that triggers the lazy module load. When navigating between two lazy loaded modules the trigger doesn't show any difference(from "" to "") and animations are not triggered.

I would suggest refining trigger to include component name or any additional modifier to allow animations to trigger.

Minimal reproduction of the bug with instructions:

  1. Create two lazy loaded modules.
  2. Observe transition animation does not work.

Expected behavior:

Animation should fire when transitioning between modules.

I would be willing to submit a PR to fix this issue:

[ ] Yes (Assistance is provided if you need help submitting a pull request)
[ ] No

tomastrajan commented 5 years ago

@alexkolt thanks for the feedback, this could have slipped us as the starter has only one lazy loaded module so it should be easy to reproduce. Would you be willing to submit a fix for this ?

pstarostka-zz commented 5 years ago

Hi @tomastrajan , is there any fix for that? I have the same issue.

alexkolt commented 5 years ago

I can submit a fix. You basically want to use something other than path. I use component name, which works as long as components are not named same in different modules: HomeComponent, AdminHomeComponent, etc.

tomastrajan commented 5 years ago

Project went through major update to Angular 8, please open new issue if the behavior persists. ( Old issue cleanup)