Questions tagged [ngrx-router-store]

54 questions
41
votes
5 answers

Navigation ID is not equal to the current router navigation id error

I'm using @ngrx/router-store in my Angularv5 app and I recently started running into a an error: Navigation ID X is not equal to the current navigation id Y (where X and Y are integers). This problem happens consistently when I navigate to route A…
John
  • 9,249
  • 5
  • 44
  • 76
5
votes
3 answers

How to silence "The feature name "router" does not exist in the state..." ngrx/router-store warning

When I add "@ngrx/router-store" to my project, it spams the app console in development mode and unit test results with the following message: The feature name "router" does not exist in the state, therefore createFeatureSelector cannot access it. …
5
votes
1 answer

How to use @ngrx/router-store inside feature module

In the NGRX documentation for Router-Store, they only provide an example with .forRoot(). When I tried using .forFeature() I discovered that no such static method exists. I would like to be able to define certain actions & effects for use within my…
Kevin Beal
  • 10,500
  • 12
  • 66
  • 92
5
votes
0 answers

ngrx Update url with search parameters

I've been looking throu the ngrx example-app and trying to expand it with the following: when searching for the book the query is written in the url as query parameters like so http://localhost:4200/book/find?query=book_title when opening the page…
Marko Čepo
  • 185
  • 13
5
votes
2 answers

How to test ngrx router store selector

In our app we have a simple store, containing at root level an AuthState and a RouterState. The RouterState is created through @ngrx/router-store methods. We have some selectors which have to use the RouterState to retrieve for example a param and…
BlackHoleGalaxy
  • 9,160
  • 17
  • 59
  • 103
4
votes
2 answers

ngrx/router-store - route parameter selector returns undefined for the child route

I have this routing set up: const SONGS_ROUTES = [ { path: "songs", children: [ // ... { path: "edit/:id", component: PerformancesComponent, // CHILD ROUTE }, { path: "", component:…
AlexB
  • 4,167
  • 4
  • 45
  • 117
4
votes
1 answer

NgRx router-store emits route parameter changes when navigating away from current page

I have an Angular component that needs to respond to route parameter changes that apply to the current page. For example, maybe I have the route page/:id, and if the :id changes, I want to respond by reloading the component's content. Using the…
4
votes
4 answers

How to set default query params for Route in Angular 7?

In our Angular-7-Application, we use @ngrx and @ngrx/router-store to get the query params into the state. A few components of the application are paginated lists. We have every list as a component and the Pagination-Component included in every…
4
votes
3 answers

NgRx - Multi level route params not able to access from CustomSerializer Router Store

I have a path declared like: { path: 'app/:userId', children: [...AppChildrenRoutes] } And then, inside AppChildrenRoutes { path: 'feature', component: MainFeatureComponent } So, at some point of my application I can have…
João Ghignatti
  • 2,281
  • 1
  • 13
  • 25
3
votes
2 answers

Mocking @ngrx/router-store's selectRouteParam

I have an Angular 8 app (core 8.1.2) using NgRx and the @ngrx/router-store (8.4.0) but am having trouble mocking a selector generated by fromRouter.getSelectors(selectRouter). The selector I have written and am trying to test looks like this: export…
serlingpa
  • 12,024
  • 24
  • 80
  • 130
3
votes
2 answers

NullInjectorError: No provider for RouterStateSerializer

I've upgraded a little side project from angular 6 to 8 and I am now getting an error that I don't understand. StaticInjectorError(Platform: core)[StoreRouterConnectingModule -> RouterStateSerializer]: NullInjectorError: No provider for…
wendellmva
  • 1,896
  • 1
  • 26
  • 33
3
votes
1 answer

Karma error: Cannot set property 'beforePreactivation' of undefined

I am trying to test a component in my Angular 5 app, which uses the @ngrx/router-store, and I was having problems with state being undefined in this selector: import * as fromRouter from '@ngrx/router-store'; export const selectRouter = (state:…
serlingpa
  • 12,024
  • 24
  • 80
  • 130
3
votes
1 answer

How to maintain parameters with ngrx/router-store

I have some parameters that I need to put to some of my pages, which means when these pages are visited, I want to check if they are in ngrx store or not, and use them if they are. One more rule for this is that if they exist in URL, use them and…
david30xie
  • 946
  • 3
  • 12
  • 23
2
votes
1 answer

Add the router-store configuration RouterState.Full throws a cryptic error message

I just started to implement the router-store of the ngrx library. I followed their instructions to implement the complete router there. In the end the RouterState.Full configuration throws the error Error: Uncaught (in promise): TypeError: Cannot…
Ling Vu
  • 4,740
  • 5
  • 24
  • 45
2
votes
1 answer

How to fetch data depending on the route in @ngrx?

We build a webapp where the user has to click through lists to get to a certain edit view. E.g. from the landing page, the user selects a client, then an agent and then gets to the edit view of that agent. The URL in that case would hold the IDs:…
Florian Gössele
  • 4,376
  • 7
  • 25
  • 49
1
2 3 4