Wednesday, August 26, 2020

What's new in Angular 9

Angular 9 was released on February 6, 2020. Ivy compiler and runtime are now made default in Version 9, this helps in faster build and smaller bundle size. Angular 9 has been updated to work with TypeScript 3.6 and 3.7
To upgrade an existing Angular 8 application to Angular 9, just run the ng update command as follows

ng update @angular/cli @angular/core

One of the major features of Angular 9 is making the Ivy compiler as default, this offers the following improvements

1. The tree-shaking feature in the Ivy compiler removed used code/references in the application and helps reduce the bundle size

2. With Ivy the TestBed does not recompile all the components, it just recompiles the components which are modified, this helps in faster testing.

3. Angular 9 improved debugging, with Angular 9 Ivy we can access instances of the components and directives, trigger change detection with applyChanges and call methods and update state. Angular 9 also provides better and detailed build error messages.

4. Angular 9 extends the Dependency Injection in Angular Core by adding 'platform' and 'any' scopes.
                @Injectable({ 
                  providedIn: 'platform' 
                }) 
                class MyService {...}
               
platform - makes the service available in a special singleton platform injector that is shared by all applications on the page.    
any — Provides a unique instance in every module (including lazy modules) that injects the token.





Search Flipkart Products:
Flipkart.com

No comments: