Wojtek
Wojtek
Jul 25, 2017 · 1 min read

Hello Victor

Truly amazing job with ngrx especially router module!
I was stopped however with an issue.
Below function:

function firstSegment(r: RouterNavigationAction) {
return r.payload.routerState.root.firstChild
}

returns only (of course! ) first segment of a route.

eg. I have 2 routes:
#/sites?search=alfa
and …
#/sites/:id

that cannot be distinguished.
Function ‘firstSegment’ returns ‘sites’ in both cases...
I wanted to have 2 distinct action on this scenario.
How that can be accomplished?

Wojtek

    Wojtek

    Written by

    Wojtek