Angular CLI allows you to create a new workspace without generating an initial application within it. If you plan to develop multiple Angular applications within the same workspace, you can start by creating an empty workspace without an initial application. This allows you to generate and manage applications individually as needed.
The following command creates a new Angular workspace without generating an initial application. It sets up the project structure and configuration files but does not create any application code. You’ll need to manually create one or more applications within the workspace.
ng new <workspace_name> --create-application=false
After running this command, you’ll have an empty workspace directory with no application code in it. You’ll need to manually create one or more applications within the workspace.
ng generate application <app_name>
Now, the CLI has generated a new Angular application within your existing workspace.
Within the Angular workspace folder, you’ll find the projects folder. Use the cd command to navigate into the projects folder.
cd projects
Use the cd command to navigate into the application folder.
cd <app_name>
To create a component in an Angular application, use the Angular CLI.
ng g c src/app/components/<component_name>
The following command creates a component in the application folder rather than within src/app.
ng g c components/<component_name>
Summary
When you need to manage related projects efficiently while sharing resources and dependencies you can use multiple applications within the same Angular workspace.