Hello world Application

Start with Hello world Application

Angular 2 can be coded in many ways.
  • First option is to start from the scratch.But I would not recommend this for beginners because there are so many dependencies need to be added to the project.
  • For beginners,I recommend following option to start with Use Quick start at Angular Github.
  • Use Angular CLI.

Setting up an Environment.

To begin with, I have used 2nd option for this example as this is a good way to start .Following is the URL for Angular Github.
Go to Project directory   ⟹  Open cmd   Type bellow URL
git clone https://github.com/angular/quickstart Hello
Then clone the github repository to your local system and this will create sample “Hello”Angularjs application.

File structure

Even Though there are so many tools available for development , I have used Visual studio Code.VS Code automatically compile and create JavaScript files because Angular 2.0 is a typescript which needed to be compiled to Javascript.
Then Open Hello Project in VS Code.Once it opened, we should add other necessary packages which required for angular 2.0. In order to do that, open cmd or Integrated Terminal in VS Code.I have Used Integrated Terminal in VS Code.
Run npm install for Install packages.

Ones completed installation process we can start coding.
After that,go to below path in Hello Project

Open Hello ⟹ src ⟹ app ⟹ app.component.ts

index.html


Once you finished the changes you can run the application.
Then,to run the application Open cmd or Integrated Terminal and type
npm start
 


Then, application will launch in the default browser.



This is the end of Hello World example & next article I will discuss about how to use Gulp to build the project.
 

Comments

Popular posts from this blog

Installing Gulp and Package.json

Why and How performance is important

Basic concepts of Blockchain