Create new angular project

Here are the steps to create a new Angular project:

Using the Angular CLI

  1. Open a terminal or command prompt.
  2. Install the Angular CLI by running the following command: npm install -g @angular/cli (or yarn global add @angular/cli if you're using Yarn).
  3. Create a new Angular project by running the following command: ng new my-app (replace my-app with your desired project name).
  4. Follow the prompts to choose the project template and configuration options.
  5. Once the project is created, navigate to the project directory by running cd my-app.
  6. Run ng serve to start the development server and open the project in your default web browser.

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 using Angular 12.2.0.

Using a code editor or IDE

If you prefer to create a new Angular project using a code editor or IDE, you can follow these steps:

  1. Open your code editor or IDE (e.g. Visual Studio Code, IntelliJ IDEA, etc.).
  2. Create a new project by selecting the "Angular" template or choosing the "Blank" template and then installing the Angular CLI.
  3. Name your project and choose the project location.
  4. Follow the prompts to choose the project template and configuration options.
  5. Once the project is created, navigate to the project directory and run ng serve to start the development server and open the project in your default web browser.

Here's an example of how to create a new Angular project using Visual Studio Code:

  1. Open Visual Studio Code.
  2. Click on "File" > "New Folder" and name your project (e.g. "my-app").
  3. Open the terminal by clicking on "Terminal" > "New Terminal" or pressing Ctrl + Shift + (backtick).
  4. Run the following command: ng new my-app (replace my-app with your desired project name).
  5. Follow the prompts to choose the project template and configuration options.
  6. Once the project is created, navigate to the project directory by running cd my-app.
  7. Run ng serve to start the development server and open the project in your default web browser.