generator-angular-crud-custom-module is basically Yeoman generator,which generate controller,services and view files of given module. To generate dynamic form from given fields of module, we used angular formly.
To use generator-angular-curd-custom-module generator, please go through below steps.
- Install `yo`.
npm install -g yo
- Install `generator-angular-crud-custom-module` from npm.
npm install -g generator-angular-crud-custom-module
- To initiate the generator, create a new folder and change terminal directory to the folder, Run:
yo angular-crud-custom-module
This command will generate following items:- app
- modules
- common
- assets
- directives.js
- filters.js
- startUpController.js
- vendor
- app.js
- index.html
- gulp
- .bowerrc
- bower.json
- app
- To create dynamic module, run:
yo angular-crud-custom-module:module
This will asked you couple of questions.Like module name,path to generate it and fields of the module. After applying this command, controllers,services and view files of this module will be generated and generated items:
Lets take `customer` as module- customer
- views
- customers.html
- addCustomer.html
- editCustomer.html
- deleteCustomer.html
- customerController.js
- customerServices.js
- customer
Lets create Customer contact
application for your organization,in which you can maintain customers
and employees
information.Create a new folder and apply below steps:
npm install -g yo npm install -g generator-angular-crud-custom-module yo angular-crud-custom-module
Last command will asked you application name, so lets give it as customerContactApp
yo angular-crud-custom-module:module
Please refer below image for reference:
So,your customer contact application is created within 10 minutes.
Here,add/update form is generated by angular formly
. So if you want to add extra fields that are not provided in this generator,then add it manually to controller file of that module.
MIT