Sharing Top Content from the Angular-sphere.

5 Features To Watch Out For in Angular v4

  • They include but not all:

    Angular v4 is in RC; this means you can start using it in your project hoping that no breaking changes will be released at final.

  • With Angular v4 (RC), you can use the syntax to handle such case:

    Let’s have a look at a possibly realistic example:

    We are simulating an HTTP async request with Observable that returns a user payload if successful.

  • Now, TypeScript allows you to explicitly say a variable can have any of those types:

    The above example simple says:

    This feature is now compliant in Angular (v4), so you could do stuff like this:

    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.

  • The project was maintained entirely outside Angular, but from Angular v4 forward, Universal will become a core Angular module.
  • Angular v4 ships flattened versions of modules in the ECMAScript Module format.

By now, most probably, we have come in peace with the fact that Angular will be rolling out features using semantic versioning. This means…

@JavaScriptKicks: 5 Features To Watch Out For in Angular 4 by codebeast #javascript #angularjs via JavaScriptKicks

By now, most probably, we have come in peace with the fact that Angular will be rolling out features using semantic versioning. This means we’ve got to worry less about nor entirely new concept (at least for now).

Angular skipped version 3 to v4 so as to sync all the different modules. The sync was broken when the Router module was already at v3, and the other modules with no API breaking changes were still at v2. Jacky Kimani announced v4 here at Scotch and highlighted some important points worth noting about this version.

With v4 in RC, there are awesome features that are worth your time. They include but not all:

Angular v4 is in RC; this means you can start using it in your project hoping that no breaking changes will be released at final. To install, run the following command:

The installation requires an update to TypeScript.

template literal used for making decision based on some JavaScript-like expression:

syntax to handle such case:

Syntax:

Let’s have a look at a possibly realistic example:

syntax to display a loading message while it waits:

. So if you wanted to use the animation features, your import would look like this:

Now, TypeScript allows you to explicitly say a variable can have any of those types:

The above example simple says:

This feature is now compliant in Angular (v4), so you could do stuff like this:

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 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, and Angular has a solution called Angular Universal which we have previously talked about.

The project was maintained entirely outside Angular, but from Angular v4 forward, Universal will become a core Angular module. Henceforth, you can easily do this:

Rob’s example is a perfect and easy place to see how the integration works out.

5. FESM

Meaning: Flattened ECMAScript Module

This is a very important update that you will likely never notice. Angular v4 ships flattened versions of modules in the ECMAScript Module format. Quoting the changelog:

has increased drastically.

A few things to watch out for:

With all these information, feel free to start experimenting this shiny version. It would also be nice to help the team and community by filing issues if you come across a weird behavior from setting up to usage. You can also read about other features and bug fixes if you think it’s necessary.

5 Features To Watch Out For in Angular v4

Comments are closed, but trackbacks and pingbacks are open.