Created
January 3, 2020 03:54
-
-
Save boniface/d5329acdd76d105300184d2478e53ed2 to your computer and use it in GitHub Desktop.
Angular & NGRX Schematics
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1) CREATE: SERVICE EXAMPLE | |
=================================== | |
ng g s roles/services/roles --skipTests -d | |
2) INTERFACE EXAMPLE: | |
====================== | |
ng g i roles/models/role model --skipTests -d | |
3) COMPONENT EXAMPLE | |
=========================== | |
ng g c roles/components/role --module=/roles/roles.module.ts --skipTests -d | |
ng g c roles/components/rolespool -m=/roles/roles.module.ts --skipTests -d | |
===========INSTALL NGRX SCHEMATICS=============== | |
npm install @ngrx/schematics --save-dev | |
ng add @ngrx/schematics | |
npm install @ngrx/{store,effects,entity,store-devtools} --save | |
ng generate @ngrx/schematics:store State --root --module app.module.ts | |
================GENERATING A FEATURE IN ANGULAR =================== | |
m=module, f=feature, co=container, en=entity, ef=effects s =--skipTests | |
ng generate m comment --flat false --routing -d | |
ng generate f comment/Comment -m comment/comment.module.ts --group --skipTests -d | |
ng generate co /comment/containers/comment --state ../reducers/comment.reducer.ts --stateInterface State -d | |
ng generate co /comment/containers/votes --state ../reducers/comment.reducer.ts --stateInterface State --skipTests | |
ng generate en /comment/model/user/User --reducers ../../reducers/comment.reducer.ts --skipTests -d | |
ng generate ef /comment/effects/user/User -m comment/comment.module.ts --skipTests -d |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment