Why Angular4 over Angular2 ?

Pardeep Jain
Aug 22, 2017 · 2 min read

From the day Angular team announced latest stable version of angular (i.e angular 4), everyone having number of questions like

  • What is the difference between angular2 and angular 4 ?
  • Which is better to learn angular2 or angular4 ?
  • How angular 4 is better then angular2 ?

etc etc etc…. !!

So, Basically in this article I will cover all the key points about angular4 over angular2. but before that let me explain why angular3 being skipped ?

WHY NOT ANGULAR 3 ?

Due to this misalignment of the router package’s version, the team decided to go straight forAngular v4. Angular is being developed in a MonoRepo it means a single repo for everything. @angular/core , @angular/compiler , @angular/router etc are in the same repo and may have there own versions.


Angular 4 is just a better upgrade version from angular 2 with some new feature included. There will be a major release of Angular after every 6 months and therefore, the angular team has decided to call the framework as just Angular instead of referring it with versions.

So, lets discuss the key points of angular4

  • They have pulled Animation Package package out from @angular/core and put into separate package. That mean if you don’t want to use that module , this extra code will not end up in your production bundles.
  • They provide support of latest version of typesctipy i.e TypeScript 2.1 & 2.2 compatibility added.
  • With some improvements they make angular bundle Smaller & Faster as compared to previous one.
  • ModuleID Removed which we are using for providing relative path during template URL and StyleUrls.
  • <Template> is now <ng-template>
  • Improved *ngIf with else condition.

<div *ngIf=”users.length > 0 ; else loading”>….</div>

<ng-template #loading>Loading…</ng-template>

  • They have introduced some new Pipes like titlecase.

{{hello I’m pardeep jain | titlecase}}

will be printed as

Hello I’m Pardeep Jain

and lot more….

Thanks :)

)
Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade