Skip to content

2. Enable @ngrx store devtools

Michael Hladky edited this page Sep 21, 2017 · 1 revision

Enable @ngrx/store-devtools

Preconditions:

  • Download the Redux DevTools Extension for your browser and install it. In this example i ues Chrome as my browser.
  • After installing and restarting the browser you should see a small icon in the top right corner of your browser header. like this:
    ngrx/store-devtool
  • On click it opens a menu where you have several options visible. Click on the Open Remote DevTools option. Now you should see a window like this.
  • After the installing and testing to open DevTools in our browser we can start to implement it in our application.
  • One last step to do is to install the @ngrx/dev-tools over npm and persist it to the package.json file.
    npm install --save @ngrx/store-devtools

ngrx-devtools-plugin-remote-view


  1. Setup StoreDevtoolsModule in app module
// app/app.module.ts

...
import {StoreDevtoolsModule} from '@ngrx/store-devtools';

export interface IDB {}
...
const reducer = {}

@NgModule({
  ...
  imports: [
    ...
    StoreDevtoolsModule.instrument({
          maxAge: 10 //  Buffers the last 10 states
    })
  ]
})
export class AppModule {

}

Now you should see the history of state changes in you dev tools.