What is new in Angular 5 ?

The Angular 5 containes lot of new features, performance improvements and more feasibility.

Package Updates

  • Angular CLI 1.5 now includes Angular Version 5.0.0
  • Typescript was updated to version 2.4
  • RXJS was updated to version 5.5

Build Optimizer

  • Tool included in the CLI for making bundler smaller
  • Marks part of the apps "pure" and removes decorators from runtime code
  • Decrease the size of your production bundles and boosts speed

AOT On By Default

  • Ahead-of-time compiler
  • Converts code before browser downloads and runs it
  • Different than the JIT (just-in-time) compiler
  • Faster rendering, fewer async requests, smaller download
  • Watch mode ngc-watch

Progressive Web Apps

  • Easier to build progressive web apps
  • still beng tinkered with
  • Goal is to make it the default otpion for most developers
  • Service workers

New HTTPClient

  • import (HttpClientModule) from '@angular/common/http'
  • Remove map(res=>res.json()) calls which are no longer needed

Validation on blurand submit

  • Need to specify to html form [ngFormOptions]="{updateOn:'submit'}"
  • then need to add in input field ngModel [ngModelOptions]="{updateOn:'blur'}"

Changes with Pipes

  • Internationslzed number, Date & Currency
  • Increased standardization across browsers
  • Old pipes will be depreciated but you can use

New Router Lifecycle Events

  • Allows developers to track the routing cycle
  • Used to do things like show spinners, measures performace of guards

RxJS 5.5 imports

  • import { Observable } from 'rxjs';
    import { map } from 'rxjs/operators/map'; range(1, 200) .pipe(filter(x => x % 2 === 1), map(x => x + x)) .subscribe(x => console.log(x));

New Router Lifecycle Events

  • Easily share app state between server and clients versions
  • ServerTransferStateModule has been added
  • Optimizes fetching data over HTTP
  • More DOM Manipulation and support