How To Install Angular2 In 3 Minutes

Posted By : Shanu Kumar | 31-Jan-2018
Angular is javascript framework. It is a TypeScript-based open-source and front-end web application platform developed by Google. It is the next version of angularJS. To use Angular the user should be familiar with the basic knowledge of JavaScript and web development. In Angular there are so many features are added:
 
Its features are,
  •  It uses Typescript languages
  • Angular uses different expression syntax,  for property binding use this "[ ]", and for event binding use this"( )" .
  • Angular 2 does not have a concept of  "scope" or controllers.
  • Controllers and $scope Replacing with components and directives.
  •  In Angular Core functionality has moved to modules.
Now let's see how to install Angular2 on ubuntu.
 
Using command line tool & angular-cli help to  install Angular. Angular-cli is a good way to set up an Angular 2 project and avoid manually copying and pasting configuration files just to get your project to build.
 
These steps help  to install Angular :
 
Step 1 : Install NPM
              
                      - Using the node.js installer you can easily install npm. 
                      - After installation,make sure that you got most recent version of npm.
                            - For most recent stable version of npm,use this command.
 
                     ------->$  sudo npm install npm -g 
 
Step 2 : Install angular-cli using NPM.
                     this command will install angular-cli
 
                       ------->$   sudo npm install -g angular-cli 
 
Step 3 : Create a new Angular 2 project.
                  After installation cli ,now ready for create a angular project  using this command.
 
                  ng new PROJECT_NAME 
 
 
Step 4 : Using this command - angular cli compile the project and start serving.

                            ng serve 
 
Output - Application is getting served at localhost:4200 on browser.
 
 
* Angular components
 
The page you see is known as application shell. and this sell is controlled by An angular component named as AppComponent.
 
Components are the basic blocks of Angular applications. its shows data on the screen, wait for user input, and take action based on that input.
 
 AppComponent distributed over three files:
 
app.component.ts      —Component class code which is written in TypeScript.
app.component.html —Component template which is written in HTML.
app.component.css   —Component's private CSS styles.
 
 
 Now Initial application structure using the Angular CLI has created.
 

About Author

Author Image
Shanu Kumar

Shanu has experience in Java EE & Java SE and also interested in EJB application. He has knowledge of SQL and worked on MYSQL & Oracle databases. He loves listening to music.

Request for Proposal

Name is required

Comment is required

Sending message..