Spread the love

Angular cli has rich features of generating components, providers, modules and many more. Angular cli can also be used for build production ready product and serve the project for local environment.

Usage of Angular cli ng generate command

  1. To generate the component

    ng generate component component_name
  2. To generate the modules

    ng generate module name
  3. To generate the pipe

    ng generate pipe name
  4. To generate the class

    ng generate class name
  5. To generate the library

    ng generate library name
  6. To generate the directive

    ng generate directive name
  7. To generate the service

    ng generate service name

How to generate component, service, module in sub folder using ng generate?

You can also use the same command for generating the component, services , modules etc using below command

ng generate component sub_folder/name

One thought on “How to generate component in angular cli?

Leave a Reply