In the present web
application improvement world,AngularJS is one of the most widely recognized
and well known JS based systems. AngularJS has been well known from the
earliest starting point for any kind of single page application improvement or
some other web application.A couple of months ago,Google (AngularJS structure
maintainers)released the new form of AngularJS i.e AngularJS 2.0. Dvelopers
like us are eagerly awaiting the release of this final version of AngularJS
Now,in this article and
furthermore in the coming consecutive articles,I will talk about quickly about
AngularJS 2.Before beginning improvement in Angular JS,we first need to
comprehend what's happening in AngularJS,we first need to understand what is
new in AngularJS 2.0 and what are new benefits of it.
What is Angular?
The most widely recognized inquiry before
beginning AngularJS i.e what is AngularJS? In common word,AngularJS is
*A MVC Structured Framework
*A single Page Application Framework
*A Client Side Templating
*A Language where written code can be
easily tested by unit testing
Now the above ke
features of Angularjs contain main concepts of innovations of angularjs.The
main idea of angularjs is the separation between html manipulation and
javascript logic in the web pages,so that html page and javascript logic can be
developed simultaneously.It always give us faster productivity from a developer
point of view.Also angularjs provides us a structured javascript framework
which can perform unit testing easily.
Why Angular Js 2.0?
Presently before going to begin the advancement in precise js 2.0,we
first need to realize why Google built up another adaptation of angularjs which
is fundamentally altogether unique in basic idea or coding idea from its past
forms i.e Angular 1.x.The primary reasons are –
AngularJS
1.x isn't so amazing in regard to the versatile application advancement.The new
version of angularjs is totally focused on mobile development. Google deals
with some new things like performance,load time in regard of the portable
advancement.
*The earlier version of AngularJS is the
modular based framework.Whereas in AngularJS 2.0 several modules have been
removed resuting in better performance.Actually AngularJS 2.0 is a component
based framework.In the current framwork,controllers and $scope have been
removed.This two main building blocks of earlier versions have been replaced by
components and directives.
*Angular 2 targets the ECMAScript6 or ES6
and all the new versions of browsers so that applications developed by using
this framework can be operated any browser of any device.In the previous
versions of the ECMAScript,everything is defined as prototype.But in ES6
version,class can be defined as javascript objects.Also in ES6,we can implement
inheritance of class objects just like OOPS.
* Fundamentally Typescript
is from Microsoft which implies that sooner rather than later AngularJS 2.0
will likewise be famous to the .NET space clients or developers.Normally
Typescript documents are aggregated in the javascript records.
Different
Between Angular 1.x and Angular 2.0
Angular
1.x
1)Structured MVC Framework
2)Separation of HTML and Business Logic in
Javascript.
Angular 2.0
1)Component Based Framework
2)It contains the same concept with more
modular pattern
3)It support typescript
4)Performance wise it is much faster.
The following is the primary key contrasts
between Angular JS 1.x and Angular 2.0.
So in the above
discussion,it is certain that for creating precise js 2.0 application or code,
we have to compose code in the Typescript language.So before going to write
down the code,I will discuss about some basic ideas of Type Script.Actually
Typescript is a superset of javascript including some extra new features which
help us write down the code in a very easy way.The main features of Typescript
are as below -
*It is a strongly type language
*It supports modules and classes
*It supports Template string
*It supports interfaces
*It supports generics
Some sample
Annotation of TypeScripts
JavaScript
var num=5;
var name = "Speros";
var something =123;
var list = [1,2,3];
function square(num) {
return num *num;
}
TypeScript
var num : number =5;
var name: string ="Speros"
var something: any =123;
var list: Array<number>=[1,2,3];
function square(num: number): number {
return num * num;
}
Now we are going to develop our first
program in AngularJS2.For this,we first need to install NodeJS in our
computer.The latest version of NodeJS can be downloaded from the Internet.
Select for INFO CAMPUS SOFTWARE TRAINING CENTER and get
trained with specialists.Find AngularJS and Angular 2, classes in Marathahalli
Bangalore at Infocampus with Real-Time Project Training,
Hands-on Experience Mentors. 100% Placement Assistance after Immediate
courses completion.
Visit:
Comments
Post a Comment