DEV Community

Amit Khirale
Amit Khirale

Posted on

Angular 4 Features introduced in 2017

Web Application development is supplying with spontaneous, interactive and clean applications with the help of extra ordinary and magical features of Angular. The angular community has included many advanced changes to angular 4 and that’s why the major version number has moved to Angular 4. The main reason behind skipping the version 3 was that the router package was in version 3.x, so instead of putting everything to 3.0 and the router to 4.0, the team chose to upgrade the versions of all the ng-modules to 4.0. Let me tell you an important news that the angular community has decided for some time-based releases occurring in three different phases:

->Angular patches will be released every week
->Few minor releases will be followed by major release
->At last, there will be a major release every 6 months

Now let’s jump into the major changes introduced in Angular 4:

Angular Universal:

Server-side rendering is the act of spitting the same HTML content in virtual DOM to the server so that they are rendered appropriately by the browser on request. This allows spiders and web robots to dig your websites and index contents when necessary.

Server-side rendering was not a thing in canonical Web Application Development until single page apps came about. Such apps use a virtual DOM concept which abstracts DOM rendering. A technique is needed to render to DOM via server requests.

The project was maintained entirely outside Angular, but from Angular 4 forward, Universal will become a core Angular module.

Type Script 2.4:

Type Script is an open source programming language created and maintained by Microsoft which is free to implement. It is super set of JavaScript which primarily provides optional static typing, classes, and interfaces. Also designed for development of large applications and trans compilers to JavaScript. Angular 4 introduced them and soon you will be able to activate the new strictNullChecks.

StrictNullChecks:

Sadly, some parts of the improved Type Checks could not be included in Angular 4 [for now] because some incompatibilities were found in the RC phase. There are plans to include this feature in v4.1, though.

Module-ID Removed:

They added a new SystemJS plugin which manually writes module is in angular 4.0, angular can take the path reference you should provide relative path is enough. It dynamically converts “component-relative” paths in template URL and style URLs to “absolute paths” for you.

Smaller & Faster Apps:

The Angular team did a great job enhancing the speed. Angular 4 applications are smaller & faster in comparison with Angular 2.It has been noticeable when doing development, but I have not been able to test much of the difference on a live server.

Animation Package:

Upgrading the Angular 2 Animations now has their own package i.e. @angular/platform-browser/animations; now import statement will look like this instead:

Import the BrowserAnimationsModule module in your app module:

Animations now have their own package i.e. @angular/platform-browser/animations.

Template ng-template:

Modify your code and change all occurrences of template

template

to

ng-template

you should use the ng-template tag instead of as caused conflicts with other usages of the tag It still works, therefore the Angular team changed it to use for Angular purposes. It will pop a warning if you use the deprecated template somewhere when you update to Angular 4, so it will be easy to spot them. It’s a breaking change; therefore they didn’t introduce this change in Angular-2 but only in Angular-4 according to semantic versioning rules.

ngIf with else:

It’s now also possible to use an else syntax in your template.

Pipes:

Angular 4 introduced a new title case pipe. It changes the first letter of each word into uppercase.

http:

Adding search parameters to an HTTP request has been simplified.

Conclusion:

A few things to watch out for:

Updating to Angular v4 could mean that some of the dependent modules will be out of sync, so you have to update them as well. Personally, the only issue I had was TypeScript which I updated to 2.2.1.

Code editors and plugins that understand the Angular template syntax will still complain about improper syntax when you use the else keyword. This is fine because your code will still work. The plugin/editor managers will make updates as soon as they can.

I guess we have covered all the major changes introduced in Angular 4. The Web Application Development using Angular 4.0 will provide more secure, flexible and scalable pathway. It really shows the Angular Teams’ commitment to making Angular best and more interactive and efficient for development.

Visit Original post 10 Major Features Introduced In Angular 4

Oldest comments (2)

Collapse
 
maxart2501 profile image
Massimo Artizzu

There are plans to include this feature in v4.1, though.

Have you written this article a while back? v4.1 came out in late April, we're now at v4.3.6 and v4.4 has just reached the RC phase.

And yes, strictNullCheck works since v4.1.

Collapse
 
amitkhirale profile image
Amit Khirale

yup!!! I have written that article way back in February and my friend suggest me to upload this article here.
So sorry for the late post will update some content later.