@practicalwebdev/schematics v2.2.7
Install
npm i @practicalwebdev/schematics
Schematics
component
ng generate @practicalwebdev/schematics:component -n <component-name> -p <html-prefix>
Parameters
--name, -n | string | REQUIRED | The name of the component. |
--prefix, -p | string | REQUIRED | The html element prefix for your component. |
--module, -m | boolean | default: true | Create a module for the component. |
--route, -r | boolean | default: false | Create a routable module for the component. |
Description
Generate an Angular component.
Places files in src/app/components
.
Generates the following files
- src/app/components/<component-name>
- index.ts
- <component-name>.component.html
- <component-name>.component.scss
- <component-name>.component.spec.ts
- <component-name>.component.ts
If module
or route
are set, it also generates a module file at:
src/app/components/<component-name>/<component-name>.module.ts
dialog
ng generate @practicalwebdev/schematics:dialog -n <dialog-name> -p <html-prefix>
Parameters
--name, -n | string | REQUIRED | The name of the dialog. |
--prefix, -p | string | REQUIRED | The html element prefix for your dialog. |
Description
Generate an Angular Material dialog component.
Places files in src/app/components
.
Generates the following files
- src/app/components/<dialog-name>-dialog
- index.ts
- <dialog-name>-dialog-body.component.html
- <dialog-name>-dialog-body.component.scss
- <dialog-name>-dialog-body.component.spec.ts
- <dialog-name>-dialog-body.component.ts
- <dialog-name>-dialog.component.html
- <dialog-name>-dialog.component.scss
- <dialog-name>-dialog.component.spec.ts
- <dialog-name>-dialog.component.ts
- <dialog-name>-dialog.module.ts
model
ng generate @practicalwebdev/schematics:model -n <model-name>
Parameters
--name, -n | string | REQUIRED | The name of the dialog. |
Description
Generate a model, with unit tests, and automatically add it to the exports from src/app/models/index.ts
Creates src/app/models/index.ts
if it does not already exist.
Places files in src/app/models
.
Generates the following files
- src/app/models/<model-name>
- index.ts
- <model-name>.model.spec.ts
- <model-name>.model.ts
service
ng generate @practicalwebdev/schematics:service -n <service-name>
Parameters
--name, -n | string | REQUIRED | The name of the dialog. |
Description
Generate an Angular service, with unit tests, and automatically add it to the exports from src/app/services/index.ts
Creates src/app/services/index.ts
if it does not already exist.
Places files in src/app/services
.
Generates the following files
- src/app/services/<service-name>
- index.ts
- <service-name>.service.spec.ts
- <service-name>.service.ts
store
ng generate @practicalwebdev/schematics:store -n <store-name>
Parameters
--name, -n | string | REQUIRED | The name of the dialog. |
Description
Generate an ngrx store, with unit tests, and automatically add it to the exports from src/app/store/index.ts
Creates src/app/store/index.ts
if it does not already exist.
Places files in src/app/store
.
Generates the following files
- src/app/store/<store-name>
- index.ts
- <store-name>.store.spec.ts
- <store-name>.store.ts