router-component-store
router-component-store copied to clipboard
Add support for NavigationExtras state
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'}}.
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.
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.
The router state isn't part of ActivatedRouteSnapshot so it's not available to the route serializer.
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.
Related to https://github.com/ngworker/router-component-store/issues/260.