New features come with Angular 4 version

New features come with Angular 4 version

New features come with Angular 4 version

This is a major release which has some breaking changes. The Angular 4 version is changes of core libraries that demand a change of SEMVER( Semantic Versioning) changes and is backward compatible with 2.x.x for most applications. The Semantic Versioning is about adding a meaning to the version numbers define as MAJOR.MINOR.PATCH which gets incremented regularly by the following rule of thumb.

  • MAJOR version: when we make incompatible API changes.
  •  MINOR version: when we introduce a new functionality which backwards-compatible.
  •  PATCH version: when we make bug fixes which are backwards-compatible.   

What’s New

Here are some great features and improvements that Angular Team has been working on for the past 3 months.


Smaller & Faster

The angular application is now smaller and faster and being focused on improvements in the coming months.


View Engine

Angular team introduces new view engine which has now less code by around 60% reduce the size of generated code for app’s component.


Animation Package

The angular team has pulled the animations out of @angular/core and into their own package. Means if you don’t use animations, this extra code will not end up in your production bundles. This change can also allow you to more easily find the documentation and to take better advantage of auto completion. You can add animation yourself to your main NgModule by importing Browser Animations Module from @angular/platform-browser/animations.


Enhanced *ngIF and ngFor

The template binding syntax now supports a couple helpful changes. You can now use an if/else style syntax, and assign local variables. There is also as clause support in template binding

<div *ngIf="userList | async as users; else loading">

 <user-profile *ngFor="let user of users; count as count" [user]="user">   

</user-profile>

</div>

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


Angular Universal

Universal, the project that allows the developer to run Angular on a server, is now up to date with Angular again, and this is the first release from Universal, originally a community-driven project, was adopted by the Angular team.


It Supports Typescript 2.1 and 2.2

Angular Team updated Angular to more recent version of Typescript 2.1 and 2.2 for compatibility that will help to improve the speed of ngc and you will get better type checking throughout your application.

 

Comments