Description
I'm facing a problem with ngrx/router-store 4.0.0
I followed the guide
When I run the app in the browser (either Chrome and Firefox), when it loads, everything is ok. But when I change the url, navigating through the links from my templates, the browser crashes.
Any thoughts of what can be happening?
My StoreModule.forRoot(reducers) and StoreRouterConnectingModule are not in the main NgModule (from app.module.ts), but in another module.
My package.json with @angular and @ngrx dependencies:
"@angular/common": "^4.3.0",
"@angular/compiler": "^4.3.0",
"@angular/core": "^4.3.0",
"@angular/forms": "^4.3.0",
"@angular/http": "^4.3.0",
"@angular/platform-browser": "^4.3.0",
"@angular/platform-browser-dynamic": "^4.3.0",
"@angular/router": "^4.3.0",
"@ng-bootstrap/ng-bootstrap": "^1.0.0-alpha.29",
"@ngrx/core": "^1.2.0",
"@ngrx/effects": "^4.0.0",
"@ngrx/router-store": "^4.0.0",
"@ngrx/store": "^4.0.0",
"@ngrx/store-devtools": "^4.0.0",
PS: I noticed that the problems is within my guard.
Inside it I have a method that dispatch an action to an Effect. When this happens, the state is changed and then a loop occurs: the guard is called again, then the action is dispatched. Then the state changes. Then the guard is called again. And so on...
What I noticed, too, is that when I access any url (example: /contents/8888), the browser first hits the root (/) and then hits the desired route/url. I don't know if this happens because my /contents/ routes are lazy loaded.