How to Run Angular Project
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:
- Install 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 package.
- 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
- Make sure you have a code editor. I recommended VS CODE as the best code editor.
- 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
- 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
After running the command, the file “hello-world” is created automatically inside the “Angular” folder as in the above image.
- . To navigate inside the project folder using the below command:
Then run the command below command to run your application.
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/