4
votes

Angular vs Angular Universal with NGRX Trying to understand how to work around @ngrx/store-devtools library for Angular Universal. I've set up this project that is a ng seed project using Angular Universal.

It has a language switcher and I can't seem to understand how the store works. Github project: https://github.com/ng-seed/universal

In the code you can see there are reducers for when you switch language, but in the devtools the state shows empty, so can't understand how it pushed to the state or how the state gets managed.

1
did you just clone the project, or did you really setup store-devtools module? this seed project does not have this implemented (you need to import StoreDevtoolsModule in your AppModule) - Martin Adámek

1 Answers

3
votes

You need to setup the @ngrx/store-devtools module first, I just tried this on that seed project and it works ok.

  1. Run npm i @ngrx/store-devtools --save to install the module.
  2. Add StoreDevtoolsModule.instrument() to the end imports array in CoreModule.
  3. Rebuild and serve (npm run build:universal-dev && npm run serve).

enter image description here