Skip to content

Instantly share code, notes, and snippets.

@jasonaden
Last active November 16, 2018 00:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasonaden/56e69e34343eb44bb376c565e4683364 to your computer and use it in GitHub Desktop.
Save jasonaden/56e69e34343eb44bb376c565e4683364 to your computer and use it in GitHub Desktop.
  • When restoring state, restore the full state rather than just the navigationId.
    • Can this cause a problem?
    • Talk to Igor about this possibly breaking change. Might need to only restore state when there is a navigationId present so the types don't cause a breakage.
    • feat(router): restore whole state object when navigating back to a page managed by Angular router
  • Allow passing of state to navigate and navigateByUrl.
  • Merge this state with navigationId when applicable. Find where we are setting navigationId as I think it is there on every navigation as currently implemented.
    • feat(router): allow passing state to navigate and navigateById methods
  • Allow state to be set for routerLink directives
    • feat(router): allow passing state to routerLink directives
  • Wire in state to all events.
    • feat(router): all router events receive the state object if available. This would be in targetState property.
router.navigateByUrl('url', null, {ignoreTracking: true});

router.events.subscribe(e => {
  if (e instanceof NavigationStart) {
    !e.futureState && e.futureState.ignoreTracking && trackingService.track(e);
  }
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment