I have the CustomRouterStateSerializer configured and working in my project and I can see the results using the Redux extension for Chrome in the DevTools. I can see the default object written to the state.
router: {
state: {
url: '/map/search',
params: {},
queryParams: {}
},
navigationId: 1
}
I have added extra information to the routes using the data property.
{
path: 'map',
component: MapComponent,
data: {
label: "Map"
},
children: [
{
path: '',
redirectTo: 'search',
pathMatch: 'full'
},
{
path: 'search',
component: SearchComponent,
data: {
label: 'Search',
icon: 'search'
}
}…
Is it possible to alter the CustomRouterStateSerializer to include the data object from the route or just the data.label string? Something like the following....
router: {
state: {
label: "Search"
url: '/map/search',
params: {},
queryParams: {}
},
navigationId: 1
}
... or ...
router: {
state: {
data: {
label: "Search",
icon: "search"
}
url: '/map/search',
params: {},
queryParams: {}
},
navigationId: 1
}
Thanks