Hello Geek, Good Morning. I hope you have a great weekend going. I wake up early today to write something about Angular.
I am going to post about how to create a sample application in Angular. That will be a starter in your Angular learning. 🙂
So, let’s start.
To run Angular application, you need the latest or any stable version of Node.js in your development machine. Also, you need a npm package manager.
What is Node.js?
What is npm?
So if you don’t have installed Node.js you can get it from here: https://nodejs.org/
Now, you have Node.js. Next thing you need to install Angular CLI, that will help you to create an Angular project, libraries and also will help you to build and deploy your projects.
You need to install Angular CLI globally. To do this open your console or terminal and write the following command.
npm install -g @angular/cli
npm: stands for the npm package manager
install: which is action to do by npm
-g: action will take globally
@angular/cli: is a package name
Now we will create a new application using Angular CLI.
Open the console or terminal and write one command.
ng new sampleapp
It will create a new folder sampleapp and it will contain your sample application.
Now, type cd sampleapp. It will open sampleapp folder.
To run the Angular application you need to run the following command.
The angular application will run on the browser with http://localhost:4000
Now, let’s learn how to create a component in the Angular.