DEV Community

Mahesh Sunuwar
Mahesh Sunuwar

Posted on

1 2

Let's Get Started With Angular and Angular CLI

Note: This tutorial is not for AngularJs but for Angular 2+. Here instead of saying Angular 2+ everytime, we will be refering Angular as Angular 2+.

If you haven't yet tried out Angular, wants to know how to install it and build your first app with it then you are in the right place.Here, We will be discussing the process of installing it in your workspace. Lets get started.

Things to Install

  1. Nodejs
  2. Angular Cli

Go ahead and install nodejs on your desired machine. Click on the installer based on your platform and it will be downloaded.

After installing node, go ahead and open cmd then type npm -v(-v for version). You'll get something like this(you'll get version number based on your installation).
Alt Text
If not, try installing node again and try again the npm -v command.

Now go ahead and type npm install -g @angular/cli.
It will install angular cli on your machine globally(-g for global installation).

At this stage, you are all setup for Angular app.
Now go type ng new getting-started-with-angular, here getting-started-with-angular is your projects name.
It will ask you for angular routing, type y and then hit enter
It will again ask you to choose stylesheet format, select one and hit enter.
Now it will create intial files for your Angular apps.

Alt Text

After it finishes just type cd getting-started-with-angular then hit enter.
Now type ng serve -o.
ng serve runs the server and serves your projects file to the localhost:4200, by default. -o is used to open browser after it finishes compiling files.

Alt Text

ng serve -o should automatically open your browser and you can see this.

Alt Text

Congratulations on setting up Angular and serving your first app Angular app.

This is a first blog on Angular Series. We will discussing more about it in our upcoming blogs.

This is my very first blog post here on dev.to. I am open for suggestions. I hope I will do better on my upcoming tutorials/blogs.

Tiugo image

Modular, Fast, and Built for Developers

CKEditor 5 gives you full control over your editing experience. A modular architecture means you get high performance, fewer re-renders and a setup that scales with your needs.

Start now

Top comments (0)

Neon image

Next.js applications: Set up a Neon project in seconds

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Get started →

👋 Kindness is contagious

Engage with a wealth of insights in this thoughtful article, valued within the supportive DEV Community. Coders of every background are welcome to join in and add to our collective wisdom.

A sincere "thank you" often brightens someone’s day. Share your gratitude in the comments below!

On DEV, the act of sharing knowledge eases our journey and fortifies our community ties. Found value in this? A quick thank you to the author can make a significant impact.

Okay