Angular is a comprehensive framework for creating browser-based single page applications. Angular 5 is a new version of a Angular framework developed and maintained by Google. The focus of this release is to make Angular faster and easier to use. Many changes are introduced in version 5 such as progressive web, template compilation, DOM support, build optimization and many more. It is a flexible framework that allows development of complex applications which are very easy to maintain and increase their productivity.
The concept of a Progressive Web Application is about enabling the development of browser-based applications that deliver a flawless user experience – regardless of the browser running them. With Angular 5 it is possible to get the features of native mobile applications such as push notifications and offline experience. This is made possible as Angular can create code and configuration with Angular-CLI on its own. Internally, service workers are used to implementing the offline ability of the application. Service workers have been given through the @angular/service-worker module. Other required components are the generation of the HTML5 caching manifest and the creation of an application shell.
The main purpose of this release is to make Angular 5 quicker and easy to use. In Angular 5, production builds created with the CLI the build optimizer applies by default. The build optimizer is included in CLI for making bundles smaller using a semantic understanding of your Angular Web Application. This element is designed to make the application smaller by removing unnecessary code. It also removes Angular decorators from your app’s runtime codes thereby reducing the size of your bundle and increasing the boot speed of your application. In addition, the build optimizer removes part of your application that is not required during runtime through tree-shaking. This activity prompts to decreased bundle size and faster application speed.
With Angular Universal State Transfer API and DOM support you can easily share application state between the server side and client side versions of your application. In Angular 5 Domino added to the platform-server which implies that you can do more DOM manipulations within server-side contexts. Also, two modules ServerTransferStateModule and BrowserTransferModule have been added to Angular Universal. These modules allow you to generate information as part of your rendering with platform-server and then transfer it to the client side so that this information does not need to be regenerated.
A pipe is a technique for exchanging data from one program process to another. Fundamentally, it passes a parameter such as the output of one process to another process which accepts it as the input. Angular 5 has new pipes for numbers, dates and currencies that increase the standardization of the procedure of internationalization between browsers and eliminate the need to use polyfills to accomplish it. These pipes have been updated to use an own implementation, depending on the Unicode Common Locale Data Repository CLDR to give broad local support and configurations that you may require.
Angular 5 support expression lowering in decorators for lambdas and the value of useValue, useFactory and information in object literals. This enables you to utilize values that must be calculated at runtime in decorators for expressions that are lowered. You would now be able to utilize lambda rather than a named function which means you can execute code without affecting your public API.
In previous Angular versions, every template change was triggering a full compilation of the application that takes a lot of time. In Angular 5, leveraging the new “pipeline transformer” that is ngc, an Angular compiler which has an ability of the TypeScript compiler. With this, you can only compile what is necessary with the introduction of a new watch mode to make web app compilation faster.
WRITTEN BY: Parth Patel
Parth Patel is a Microsoft Certified Solution Associate (MCSA) and DotNet Team Lead at CMARIX, a leading Asp.net mvc development company. With 10+ years of…
FEW MORE POSTS BY Parth Patel: