Search code examples
javascriptangularangular-cliangular-cli-v6

How to create components through command line when there are multiple projects (Angular CLI 6)


I'm using latest Angular CLI version (v6). I have multiple apps in the same code inside the projects folder.

I want to generate modules and components inside those projects using command line.


Solution

  • This can be achieved as below.

    ng generate module my-module --project=my-project1 --> creates a module in project1
    
    ng generate component my-component--project=my-project1 --> creates a component in project1
    

    Check my blog post for more information here.

    If you are using CLI old version (V1) check this