Setting up an Angular project

Stefano Di Cecco
2 min readDec 28, 2022

Setting up an Angular project can seem intimidating for developers new to the framework, but it is actually quite straightforward once you understand the process. In this article, we will walk through the steps required to set up an Angular project from scratch.

Before we get started, you will need to make sure that you have the following tools installed on your machine:

  • Node.js: Angular is built with JavaScript, and you will need Node.js installed on your machine to run Angular. You can download the latest version of Node.js from the official website (https://nodejs.org/).
  • Angular CLI: The Angular CLI (Command Line Interface) is a command-line tool that is used to create, build, and manage Angular projects. To install the Angular CLI, open a terminal window and enter the following command:
npm install -g @angular/cli

With these tools installed, you are now ready to create a new Angular project. To do this, open a terminal window and navigate to the directory where you want to create your project. Then, enter the following command:

ng new my-project

This will create a new Angular project with the name “my-project” in the current directory. The Angular CLI will handle creating all of the necessary files and directories for the project, and it will also install the required dependencies.

cd my-project

With the project set up, you can now start the development server by entering the following command:

ng serve

This will start the development server and open a new browser window with your Angular application running. The development server will automatically reload the application whenever you make changes to the code, so you can see your changes in real-time as you work.

To stop the development server, press "CTRL + C" in the terminal window.

That's all there is to it! With these simple steps, you can set up a new Angular project and start building your application. As you work on your project, you may want to explore other Angular CLI commands, such as "ng generate" for creating new components, services, and other project files, and "ng build" for building a production-ready version of your application.

I hope this article has helped you understand the process of setting up an Angular project. With a little practice, you'll be building your own Angular applications in no time!

--

--

Stefano Di Cecco

Self-motivated IT professional with great knowledge and proficiency in JavaScript, TypeScript. Expertise in frameworks like React.js, Angular.