Saturday 8 April 2017

Angular 1 vs Angular 2

Angular 1 vs Angular 2


  • First thing, Angular 2 is not the upgrade of Angular 1 Angular 2 is completely rewritten.
  • Angular  is using Typescript which is super set of javascript (It doesn’t mean only typescript, dart also).
  • Angular 1.x was not built with mobile support in mind, where Angular 2 is mobile oriented.
  • Angular 1 core concept was $scope, and you will not find $scope in angular 2.0. Angular 2 is using zone.js to detect changes. See the below code.
  • Angular 1.x controllers are gon. We can say that controllers are replaced with “Components” in Angular 2.


  • In Angular 2, Structural directives syntax is changed. ng-repeat is replaced with *ngFor.

  • In Angular 2local variables are defined using hash(#) prefix.



  • Two-way data bindingng-model replaced with [(ngModel)]



In Short below are the comparison points


· Angular 2 is mobile oriented & better in performance.
· Angular 2 provides more choice for languages.
· Angular 2 implements web standards like components.
· AngularJS 2.0 is not easy to setup as AngularJS 1.x.
· Angular 1.x controllers and $scope are gone.
· Different ways to define local variables.
· Structural directives syntax is changed.
· Angular 2 uses camelCase syntax for built-in directives.
· Angular 2, directly uses the valid HTML DOM element properties and events.
· One-way data binding directive replaced with [property].
· Two-way data binding: ng-model replaced with [(ngModel)]
· Way of Bootstrapping Angular Application is changed:
· Ways of Dependency Injection is Changed- syntax changed.
· Way of routing is Changed- syntax changed.

5 comments:

Unknown said...

Great explanation! Thanks for sharing!

SAVIOUR said...

Incomplete information

SAVIOUR said...

Incomplete information

Unknown said...
This comment has been removed by the author.
Unknown said...

This is just a basic differences between Angular1 and Angular 2.

More on the way soon on Angular 2...