Simple steps to run the first Angular App?

How to Run Angular Project

In this article, we will learn how to run the basic ‘hello world’ program in an angular project. To get started with angular you need to know the basics of HTML, CSS, and JavaScript. However, it makes use of typescript so a very basic knowledge of typescript makes a lot of difference. Typescript is very simple to learn if you know JavaScript but I would recommend you go through ES2015.

To start building angular apps, we need the below environment:

  • Node & NPM
  • Angular CLI
  • Text Editor – VS CODE

Steps to run the first angular program:

  1. how to run angular projectInstall node.js using this link:   If you successfully installed nodeJS, Node Package Manager (NPM) also will be installed. To verify it, you can run the below commands on your command prompt as in the above image. If that displays your current version, our node, and NPM is successfully installed. That says any error you should reinstall the to run angular project
  2. Then we should install angular CLI. Angular CLI is basically a command line interface for angular and it allows you to generate building blocks of our angular application by just type out the command. It makes your development quicker and easier and all this while following the best practices. To install angular CLI, we need to enter the below commands:
    npm install -g @angular/cli
  3.  Make sure you have a code editor. I recommended VS CODE as the best code editor.
  4. After installing VS code, you should go to terminal > new terminal and make sure you’re inside the angular folder. To create a new angular project, you need to run the below command:
    ng new ProjectName
  5. Here, in the place of “ProjectName,” you should enter your project name. For example, I am going to create a “hello world” project, so I named the project name “hello-world”.
    ng new hello-world

    how to run angular projectAfter running the command, the file “hello-world” is created automatically inside the “Angular” folder as in the above image.

  6. . To navigate inside the project folder using the below command:
    cd hello-world

    Then run the command below command to run your application.

    ng serve

once we got the message compiled successfully from the web pack, you can go back to your browser and open this URL: https://localhost:4200/


Leave a Reply