How to setup a new Angular Project
To set up a new Angular project, you will need to have the following prerequisites installed on your machine:
-
Node.js: Angular requires Node.js to be installed on your machine. You can download the latest version of Node.js from the official website
(https://nodejs.org/).
- Angular CLI: Angular CLI (Command Line Interface) is a command-line tool that helps you to create and manage your Angular projects. To install the Angular CLI, open a terminal and run the following command:
npm install -g @angular/cli
Once you have Node.js and Angular CLI installed, you can create a new Angular project by running the following command in your terminal:
ng new my-project
Replace "my-project" with the desired name for your project. This will create a new directory with the given name and generate the necessary files and folders for an Angular project inside it.
You can then navigate into the project directory and start the development server by running the following commands:
cd my-project
ng serve
This will compile and serve your Angular app, and it will be available at http://localhost:4200/. The development server will also reload the app automatically whenever you make changes to the code.