There are five major releases of Angular. The first version that was released is Angular 1, which is also called AngularJS. Angular 1 was followed by Angular 2, which came in with a lot of changes when compared to Angular 1.
The structure of Angular is based on the components/services architecture. AngularJS was based on the model view controller. Angular 6 released in May 2018 proves to be a major breakthrough and is the latest release from the Angular team after Angular 5.
Angular 6 is almost the same as Angular 5. It has a backward compatibility with Angular 5. Projects developed in Angular 5 will work without any issues with Angular 5.
Let us now see the new features and the changes made in Angular 5.
Angular 5 was released in Nov 2017. As per its goal of speed and size, It was way faster and of smaller size than that of Angular 4. Following are the features that were introduced in Angular 5.
HTTPClient API − HTTPClient API was introduced to deprecate the HTTP library. HTTPClient API is much faster, secure and efficient than HTTP library.
Multiple export aliases − A component can be exported using multiple aliases to ease the migration process.
Internationalized Pipes for Number, Date, and Currency − New pipes are introduced for better standardization.
Lambda support − lambda expressions with proper names can be used instead of functions.
Build Optimizer - Build Optimizer introduced. It optimizes the build size and improves the application speed. Angular CLI uses Build Optimizer automatically.
Improved Compiler − Compiler from Angular 5 onwards supports incremental compilation leading for faster compilation. Compiler uses TypeScript transforms, a new feature of TypeScript 2.3 available onwards.
Let us now see the new features added to Angular 6 −
Updated Angular CLI, Command Line interface − New commands added, like ng-update to migrate from previous version to current version. ng-add to quickly add application features to make application a progressive web apps.
Updated CDK, Component Development Kit − Supports creating custom UI elements without need of angular material library. Supports responsive web design layouts. Supports overlay packages to create pop-ups.
Updated Angular Material − New Tree component added, mat-tree, a styled version and cdk-tree, a unstyled version, to represent a hierarchical structure like tree.
Usage of RxJS, a reactive JS library
Angular Element − Allows Angular Components to be published as Web Components which can then be used in any HTML page. Using Angular Element package, native custom elements can be created easily.
Multiple Validators − Allows multiple validators to be applicable on a form builder.
Tree Shaking on Services − Now tree shaking can be applied on services as well to remove the dead code.