Reproduced: https://stackblitz.com/edit/ngrx-seed-s6jcdy?file=src%2Fapp%2Ftest.component.ts
I've followed all the steps from the https://ngrx.io/guide/router-store, but selectRouteData doesn't return data from routes resolvers. Am I missing something that is not documented?
constructor(
private route: ActivatedRoute,
private store: Store<AppState>
) {}
readonly center$ = this.store.select(selectRouteData).pipe(
tap(data => {
console.log('selectRouteData', data, this.route.snapshot);
}),
);
But data exists in the ActivatedRoute snapshot.

selectRouteData should return data from activated route.
Latest versions.
Do you got a reproduction for this @greg-md ?
@timdeschryver is there an active template for ngrx version 10 in stackblitz? I couldn't find one. Basically I did everything from the docs.
StoreRouterConnectingModule is app module;StoreModule.forRoot(appReducers),
StoreRouterConnectingModule.forRoot(),
routerReducer in the app reducers.import { ActionReducerMap } from '@ngrx/store';
import { routerReducer, RouterReducerState } from '@ngrx/router-store';
export type AppState = {
router: RouterReducerState<any>;
};
export const appReducers: ActionReducerMap<AppState> = {
router: routerReducer,
};
export const selectRouter = createFeatureSelector<AppState, RouterReducerState>('router');
export const {
selectRouteData, // select the current route data
} = getSelectors(selectRouter);
readonly data$ = this.store.select(selectRouteData);
And it's always empty, but I have resolvers inside the current router and I could get data from activated route snapshot.
@greg-md there is this one, https://stackblitz.com/edit/ngrx-seed?file=src/app/app.component.ts.
It's a basic template, with only one rout but the set up is done for all the packages.
@timdeschryver Thanks! Here it is: https://stackblitz.com/edit/ngrx-seed-s6jcdy?file=src%2Fapp%2Ftest.component.ts
So the problem are resolvers.
const routes: Routes = [
{
path: '',
component: TestComponent,
// 馃憞 this doesn't get "selected" with `selectRouteData`
resolve: {
test: TestResolver,
},
// 馃憞 this gets "selected" with `selectRouteData`
data: {
id: 1
}
},
];
@timdeschryver right. I think they should be included as well in selectRouteData
I'm not very familiar with it, but it seems that Angular doesn't expose the data from the resolved in the router events. So if Angular doesn't expose it, I don't know if we can...

@greg-md do you know how we could include the data in the payload?
related to #358
navigationActionTiming: NavigationActionTiming.PostActivation
@greg-md Adding this config seems to help but not sure regarding the remarks by Brandon in 358.
Most helpful comment
So the problem are resolvers.