Wednesday, 26 May 2021

Angular setup in your machine

 

To Install Angular in your machine you need to follow below steps:

1. Install node.js (from https://nodejs.org/en/download/)



It' recommended to install latest stable release.

once you will get .msi (installer) It's similar to other software installation.(click next--> next-> finish.)

Now, Open command Prompt and type command : node --version 

It will display version of installed node in your machine.


2.Install Angular CLI

To install angular cli type  npm install -g @angular/cli on command prompt.

-g is used in above command to install angular globally i.e. machine wide, so it would be accessible for all other angular applications. 


you will see above screen once you'll run npm install -g @angular/cli command.

Now you can check version of installed angular cli by typing ng --version command.


You are done with angular setup.

3. Create first angular application

To create angular app, type ng new application-name on command prompt.(application-name may be any valid name you want to give to your application for example ng new HelloWorld).

I have created 'HelloWorld' application in RnD directory, and Opened it in Visual studio code editor.
you can use any editor you wish.

you will see, after running ng new HelloWorld command,  a new directory 'HelloWorld' with multiple files and sub directory created inside of directory where you ran 'ng new..' command.

Go to visual studio code : File --> Open Folder..--> Choose HelloWorld directory



you can run newly created application by typing command : ng serve on command prompt.

type http://localhost:4200/ in browser to see live running app.

Thank you.


No comments:

Post a Comment

Parent child component communication in Angular. (Approach-1)

  If we will make a property in Child component and somehow if it's a two-way bindable property, then Child would be able to set its val...