dharma-generator v0.1.11
Getting Started With Schematics
Schematic to generate custom components for ngx-admin template
NGX-ADMIN
Clone respository: https://github.com/akveo/ngx-admin
Build Watch locally
To run, simply do:
npm install
npm run build:watch
Testing
To test locally, install @angular-devkit/schematics-cli
globally and use the schematics
command line tool. That tool acts the same as the generate
command of the Angular CLI, but also has a debug mode.
Check the documentation with
schematics --help
Unit Testing
npm run test
will run the unit tests, using Jasmine as a runner and test framework.
Publishing
To publish, simply do:
npm run build
npm publish
That's it!
Generate form-base
Description: Component with Form Group
ng generate dharma-generator:form-base <directory-of-component>/<component-name> --<options>
Options:
- text: form control name (String)
- Select: form control name (String)
- Multiselect: form control name (String)
- Slider: form control name (String)
- Datepicker: form control name (String)
- col: Bootstrap column size (0 - 12)
Example:
ng generate dharma-generator:form-base pages/my-component/new-component --text input1,input2 --select input3,input4
Generate form-container
Description: Container to handle form requisitations between client and server
ng generate dharma-generator:form-container <directory-of-component>/<component-name> <service-name>
Options:
- service-name: Name of the service (String)
- generateService: Generate service or not (Boolean)
- col: Bootstrap column size (0 - 12)
Example:
ng generate dharma-generator:form-container pages/my-component/new-component my-service --col 12
Generate list-container
Description: Container to handle list requisitations between client and server
ng generate dharma-generator:list-container <directory-of-component>/<component-name> --<options>
Options:
- service-name: Name of the service (String)
- generateService: Generate service or not (Boolean)
- col: Bootstrap column size (0 - 12)
- text: form control name (String)
- Select: form control name (String)
- Multiselect: form control name (String)
- Slider: form control name (String)
- Datepicker: form control name (String)
Observation: In that case the forms options will be applicated in filter component
Example:
ng generate dharma-generator:list-container pages/my-component/new-component my-service --col 12 --text input1,input2