Create a new angular project
Here are the steps to create a new Angular project:
Using the Angular CLI
-
Open a terminal or command prompt.
-
Install the Angular CLI by running the following command:
npm install -g @angular/cli
-
Create a new Angular project by running the following command:
ng new my-app
Replace
my-app
with the name of your project. -
Follow the prompts to choose the project template and configuration options.
Using the Angular CLI with a specific version
If you want to create a new Angular project with a specific version of Angular, you can specify the version when running the ng new
command. For example:
ng new my-app --version 12.2.0
This will create a new Angular project with Angular 12.2.0.
Using the Angular CLI with a custom template
If you want to create a new Angular project with a custom template, you can specify the template name when running the ng new
command. For example:
ng new my-app --template full
This will create a new Angular project with the full template, which includes all the features and dependencies.
Using the Angular CLI with a specific directory
If you want to create a new Angular project in a specific directory, you can specify the directory path when running the ng new
command. For example:
ng new my-app --directory /path/to/my/project
This will create a new Angular project in the specified directory.
Verify the project creation
Once the project is created, you can verify that it was created successfully by running the following command:
cd my-app
ng serve
This will start the Angular development server and open the project in your default web browser.
That's it! You now have a new Angular project created using the Angular CLI.