Skip to content

ShivaliPatel/generator-angular-crud-custom-module

Repository files navigation

generator-angular-crud-custom-module

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.

Getting Started

To use generator-angular-curd-custom-module generator, please go through below steps.

  1. Install `yo`.

    npm install -g yo
  2. Install `generator-angular-crud-custom-module` from npm.

    npm install -g generator-angular-crud-custom-module
  3. 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
  4. 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
If you want to add more modules,then repeat step 4.

Example

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:

alt text

So,your customer contact application is created within 10 minutes.

Output

Customers list

alt text

Add Customer

alt text

Edit Customer

alt text

Delete Customer

alt text

Generated files

app.js

alt text

controller.js

alt text

services.js

alt text

Note

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.

License

MIT

About

Angular CRUD generator for module, which contain controller,service and templates(list,add,update and delete).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published