Please Like and Share

I have 4+ experience and working as software Engineer with Hytech professionals India PVT ltd and also working as Consultant,Trainer,Blogger and Author on Microsoft technologies,Also I have Trained more than 500+ IT professionals.I have knowledge about Asp.net,C#,SQL,Project management,replication,MVC,WebApi,SSRS,PostMan,TFS,SVN,Swagger,WMI,Agile,SignalR,Angularjs,IIS configuration.

In this blog i am going to explain "what is difference between angular 2 and 4",What new features added in angular 4.

Angular 4 contains some additional features over Angular 2.

Smaller & Faster Apps

View Engine Size Reduce

Animation Package

NgIf and ngFor Improvement

Template

NgIf with Else

Use of AS keyword

Pipes

HTTP Request Simplified

Apps Testing Simplified

Introduce Meta Tags

Added some Forms Validators Attributes

Added Compare Select Options

Enhancement in Router

Added Optional Parameter

Improvement Internationalization

Smaller & Faster Apps

Angular 4 application is smaller and faster in comparison to Angular 2.

View Engine Size Reduced
There are some changes under the hood to AOT generated code compilation that means Angular 4, hasimproved the compilation time. These changes reduce around 60% of the size in most cases.

Animation Package
Animations now have their own package i.e. @angular/platform-browser/animations

A new interface “paramMap” and “queryParamMap” has been added and it was introduced to represent the parameters of a URL.

const uid = this.route.snapshot.paramMap.get('UId');

this.userService.get(uid).subscribe(user => this.name = name);

CanDeactivate

This “CanDeactivate” interface now has an extra (optional) parameter and it contains the next state.

I18n
The internationalization is a tiny improvement.

//Angular 4-

<div [ngPlural]="value">

<ng-template ngPluralCase="0">there is nothing</ng-template>

<ng-template ngPluralCase="1">there is one</ng-template>

</div>

//Angular 2-

<div [ngPlural]="value">

<ng-template ngPluralCase="=0">there is nothing</ng-template>

<ng-template ngPluralCase="=1">there is one</ng-template>

</div>

You have just read an article that categorized by title AngularJs 2 /
Interview Question
by title What is Difference Between Angular 2 And Angular 4 ?. You can bookmark this page with a URL https://bikeshsrivastava.blogspot.com/2017/07/what-is-difference-between-angular-2.html. Thank You!

Author: Bikesh Srivastava - Thursday, 20 July 2017

There are currently no comments for "What is Difference Between Angular 2 And Angular 4 ?"