What is the difference between Angular 2 and Angular 4?
Comparison between Angular 2 and Angular 4:
Angular 2
|
Angular 4
| |
Program
|
Angular
|
Angular
|
Launched
|
September 14, 2016
|
March 23, 2017
|
Backward Compatibility
|
Not compatible with AngularJS.
|
Angular 4 is backward compatible with Angular 2
|
Compatibility with TypeScript
|
Compatible with TypeScript 2.0. Not compatible with TypeScript 2.1 and TypeScript 2.2.
|
Compatible with TypeScript 2.1 and TypeScript 2.2
|
File Size
|
60% larger bundled file size as compared to Angular 2
|
60% Reduced bundled file size as compared to Angular 4
|
Directives and controls
|
Limited directives and controls
|
New directives and controls
|
Component splitting features
|
Limited to no component splitting features
|
Component splitting features
|
Code reusability
|
Limited code reusability
|
Increased code reusability
|
Application development
|
Slower application development as compared to Angular 4
|
Accelerated application development as compared to Angular 2
|
Ahead of Time (AOT)
|
No Ahead of Time (AOT)
|
Introduced Ahead of Time (AOT)
|
View Engine
|
No view engine
|
Introduced view engine
|
Animation Function
|
The Angular animation function requires the @angular/code module, essentially creating its own package.
|
Animation package is not required, which reduces the size of the code.
|
*ngIf and *ngFor
|
Limited *ngIf and *ngFor. Can’t utilize an if/else design syntax, and assign local variables
|
Improved *ngIf and *ngFor. Can utilize an if/else design syntax, and assign local variables like if to unroll an observable
|
Angular Universal
|
Does not contain the external and internal work from Universal
|
Contains the external and internal work from Universal
|
Source maps
|
Does not contain source maps
|
Source maps that provide a meaningful context concerning the original template
|
0 comments:
Post a Comment