English 中文(简体)
Angular 9 - What’s New?
  • 时间:2024-11-05

Angular 8 - What s New?


Previous Page Next Page  

Angular community has continuosly updating its version. This chapter explains about Angular 9 version updates.

Install Angular 9

If you want to work with Angular 9, first you need to setup Angular 9 CLI using the below command:


npm install -g @angular/cp@^9.0.0 

After executing this command, you can check the version using the below command:


ng version 

Angular 9 Updates

Let’s understand Angular 9 updates in brief.

Ivy compiler

Ivy compiler becomes the default compiler in Angular 9. This makes apps will be faster and very efficient. Whereas, Angular 8 Ivy is optional. We have to enable it inside tsconfig.json file.

Ivy compiler supports the following features:

    Performs faster testing − TestBed implementation helps to test more efficient.

    Improved CSS class and styles − Ivy styles are easily merged and designed as predictable.

    Improved type checking − This feature helps to find the errors earper in development process.

    Enhanced debugging − Ivy comes with more tools to enable better debugging features. This will be helpful to show useful stack trace so that we can easily jump to the instruction.

    Ahead-of-Time compiler − This is one of the important improvements in compiler’s performance. AOT builds are very faster.  Improved internationapzation - i18n substitutions helps to build more than ten times faster than previous versions.

Repable ng update

ng updates are very repable. It contains clear progress updates and runs all of the migrations. This can be done using the below command:


ng update --create-commits

Here,

–create-commits flag is used to commit your code after each migration.

Improved Dependency Injection

@Injectable service helps to add injector in your apppcation. providedIn meta data provides new option, platform to ensure the object can be used and shared by all apppcation. It is defined below:


@Injectable({
   providedIn:  platform 
}) 
class MyService {...} 

TypeScript 3.8

Angular 9 is designed to support 3.8 version. TypeScript 3.8 brings support for the below features:

    Type-Only Imports and Exports.

    ECMAScript Private Fields.

    Top-Level await.

    JSDoc Property Modifiers.

    export * as ns Syntax.

Angular 9.0.0-next.5

Angular 9.0.0-next.5 build has small size of main.js file, which makes better performance compare to previous version of Angular 8.

IDE enhancement

Angular 9 provides imporves IDE supports. TextMate grammar enables for syntax highpghting in inpne and external templates.

Conclusion

Angular is flexible, ever improving, continuously updated and dependable framework. Angular greatly simppfy the process of SPA development. By providing new features in each release pke Angular Universal, Progressive Web App, Web workers, Bazel build, Ivy Compiler, etc., Angular will have a long pfe and complete support of the front end developer.

Advertisements