Trainings

Monday, May 14, 2018

Angular 2 vs 4 vs 5


Comparison of Angular 2 ,4 and 5. Angular 6 just released...will be adding

Angular 2
Angular 4
Angular 5
 - Improved Databinding
 - based entirely on components
 - Support for TypeScript -  you get access to all the advantages, libraries, and technologies associated with TypeScript.
 - Templates – template is now ng-template. you should use the ng-template
 - In Angular 2.0, we use an email validator, using pattern option. but in Angular 4.0, there is a validator to validate an email.
 - it’s possible to render Angular applications outside of the browser.
 - *ngComponentOutlet directive enables the web developer to develop dynamic components in a declarative way.
 - Animations Animations now have their own package i.e. @angular/platform-browser/animations.
 - support for TypeScript 2.5 peviously typeScript 2.3.
 - Angular Universal ng generate universal                      
 - support for Angular CLI 1.6 building applications which take advantage of this new feature. Using @angular/service-worker can improve the loading performance of your applications.
 - support AppShell. App Shell uses the router to render your application.
ng generate app-shell
 - In Angular 5 you can give multiple names to your components while exporting,
 - introduced new pipes for numbers, dates and currencies .
 - ngModelChange is now emitted after the value gets updated.
 - form validation can be fired on submit now instead of default on blur.
 - new life cycle events being added to the router and those are ActivationStart, ActivationEnd,  ChildActivationStart, ChildActivationEnd, GuardsCheckStart, GuardsCheckEnd, ResolveStart and ResolveEnd.
 - In earlier versions of Angular, we were depending on i18n whenever we wanted to support internationalization in our application.  In Angular 5 now no need to depend on i18n, it provides a new date, number, and currency pipes which increases the internationalization across all the browsers and eliminates the need of i18n polyfills.
 - Before Angular 4.3 versions, we were using @angular/HTTP module for all kinds of HTTP requests. Now, in Angular 5, @angular/http module has been deprecated and introduced new module called HttpClientModule which comes under @angular/common/http package
In Angular 5, multiple names support for both directives and components