You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: projects/ngrx.io/content/guide/router-store/selectors.md
+24-34Lines changed: 24 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,8 @@
2
2
3
3
The `getSelectors` method supplied within `@ngrx/router-store` provides functions for selecting common information from the router state.
4
4
5
-
The `getSelectors` method takes a selector function as its only argument to select the piece of state where the router state is being stored.
5
+
The default behavior of `getSelectors` selects the router state for the `router` state key.
6
+
If the default router state config is overwritten with a different router state key, the `getSelectors` method takes a selector function to select the piece of state where the router state is being stored.
6
7
The example below shows how to provide a selector for the top level `router` key in your state object.
7
8
8
9
**Note:** The `getSelectors` method works with the `routerReducer` provided by `@ngrx/router-store`. If you use a [custom serializer](guide/router-store/configuration#custom-router-state-serializer), you'll need to provide your own selectors.
@@ -13,13 +14,8 @@ Usage:
13
14
14
15
[Full App Used In This Example](https://stackblitz.com/edit/ngrx-router-store-selectors?file=src/app/car.state.ts)
@@ -138,11 +128,11 @@ Using `selectRouteParam{s}` will get the `matched` param but not the `urlPath` p
138
128
139
129
If all params in the URL Tree need to be extracted (both `urlPath` and `matched`), the following custom selector can be used. It accumulates params of all the segments in the matched route:
0 commit comments