1.0.2 • Published 5 years ago
ngrx-angular-cli-extension v1.0.2
NGRX-ANGULAR-CLI-EXTENSION
Generates a NgRx Store Feature Module with CRUDL actions over an entity according the next stucture:
├── feature-modules
| └── feature-module
| ├── components
| | └── example-component
| | └── ...
| └── store
| ├── actions.ts
| ├── effects.ts
| ├── reducer.ts
| ├── selectors.ts
| └── state.ts
├── models
| └── entity.ts
└── services
└── entity.service.ts
Table of Contents
Setup
Install ngrx-angular-cli-extension from npm:
npm install ngrx-angular-cli-extension --save-dev
After installing ngrx-angular-cli-extension, install the NgRx dependencies:
npm install @ngrx/store @ngrx/effects @ngrx/entity @ngrx/store-devtools --save
Set ngrx-angular-cli-extension as the default collection in your Angular CLI project:
ng config cli.defaultCollection ngrx-angular-cli-extension
Now you can use the Angular CLI commands as usual and the ngrx-angular-cli-extension commands.
Usage
The following command generates a feature module
ng generate feature-module <entity>
Don't forget to add the newly created module to parent module.