简体   繁体   中英

Is there some example to create ngrx/Store on Angular 7 in one command

I am creating new web Dashboard and using ngrx/store for loading and data in Angular 7. For about third time i am creating and generating files for different store interface and it seams that it will not stop here. So i wonder is there some cli bundle to create store for module in one commnad line.

I am using cli as best to create action,effects,reducer,state every time. I was try some solutions from cli but its create only reducer and index.ts.

npm install @ngrx/schematics --save-dev
npm install @ngrx/{store,effects,entity,store-devtools} --save
ng config cli.defaultCollection @ngrx/schematics
ng generate @ngrx/schematics:store State --root --module some-app.module.ts -d

Probably the ng update commands, for example https://ngrx.io/guide/store/install#installing-with-ng-add

ng add @ngrx/store

This will install @ngrx/store and do a minimal scaffold to get you started.

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