How to create Angular project from scratch

How to create Angular project from scratch

In this article we will discuss how to create angular project from scratch. Follow step by step guide to go forward.

Step 1 : Check and install node and npm

Check using below commands weather node and npm are installed and what versions

node -v
npm -v
Angular project

you should see details as above if installed.

Step 2 : Install angular CLI

npm install - g @angular/cli

The above command will install angular cli by which we will next create our project.

Preview

Step 3: Create project

ng new myNewApp

Next use above command which will create a new project by name “myNewApp”.

You will be asked to add angular routing type “yes” and choos “css” for css options.

Preview

You will see above folder structure will be created.

Step 4: Go to your above created project directory

cd myNewApp
Preview

Step 5 : Serve your application

ng serve

The above command will serve your application on localhost at port 4200.

Preview

Step 6 : Go to your browser and hit

http://localhost:4200/

You will see below screen which means you have successfully created angular project and its running.

Create angular project

Great, you have made it to our first angular project. This is how you create angular project from scratch.

Checkout next blog here to understand folder structure of angular.