简体   繁体   中英

Using Ngrx DevTools with Ionic 5

I am trying to follow this link to use the Ngrx DevTools. But Ionic uses @ionic/angular-toolkit, and we need to enable the Ngrx Schematics which replaces that. Is there a way to have both?

Changes in Angular.json
  "cli": {
--"defaultCollection": "@ionic/angular-toolkit"
++"defaultCollection": "@ngrx/schematics"
},

@ionic/angular-toolkit: Angular Schematics and Builders for @ionic/angular apps

I was able to use the ngrx schematics to generate my stores for my Ionic 5 app by:

  1. installing the @ngrx/schematics and allowing them to replace the @ionic/angular-toolkit.
  2. running "ng generate store..."
  3. replacing the "defaultCollection" entry with "@ionic/angular-toolkit"

This seemed to allow me to get it done -- until Ionic provides an update to their schematics for this.

Yes, this is a hack, and requires me to do this each time that I want to gen a store, but it allows me to use ngrx tools, would like to learn a cleaner way from someone!

  1. Install @ngrx/store-devtools
  2. Add "StoreDevtoolsModule.instrument({ maxAge: 30 })" in imports in app.module.ts

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM