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

Add support for NavigationExtras state #303

Open
fleish80 opened this issue Dec 25, 2022 · 5 comments
Open

Add support for NavigationExtras state #303

fleish80 opened this issue Dec 25, 2022 · 5 comments
Labels
enhancement New feature or request

Comments

@fleish80
Copy link

Support for NavigationExtras state is missing. For a example this.router.navigate(['/some-path'], {state: {some-state-key : 'some-state-value'}}, should add to #serializeRouteSnapshot a property something like {navigationState: {some-state-key : 'some-state-value'}}.

@LayZeeDK
Copy link
Member

Thank you for your syggestion, @fleish80. The serializer is mostly based on that of NgRx Router Store, meaning this feature must not be supported by that library. I would be interested to learn about discussions of a similar proposal for NgRx Router Store.

@LayZeeDK LayZeeDK added the enhancement New feature or request label Dec 25, 2022
@LayZeeDK
Copy link
Member

LayZeeDK commented Dec 25, 2022

I'm currently working on the RouterHistoryStore. Seems like this feature request could be more related to that than to the RouterStore.

@fleish80, please send use cases for router state usage.

@LayZeeDK
Copy link
Member

The router state isn't part of ActivatedRouteSnapshot so it's not available to the route serializer.

@fleish80
Copy link
Author

Thank you for your syggestion, @fleish80. The serializer is mostly based on that of NgRx Router Store, meaning this feature must not be supported by that library. I would be interested to learn about discussions of a similar proposal for NgRx Router Store.

In the Ngrx Router Store, it's possible to use your own custom serializer, and it's possible there to inject anything You want, and thus you can, for example, to inject the Router, from which you can extract the NavigationExtras.
This could be the solution.

@LayZeeDK
Copy link
Member

LayZeeDK commented Jan 1, 2023

Related to #260.

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

No branches or pull requests

2 participants