Angular v6.1 Now Available — TypeScript 2.9, Scroll Positioning, and more

July 26th, 2018

Angular version 6.1 has been released. This is a minor release that is a drop-in replacement for 6.0 containing new features and bugfixes.

Angular v6.1 Now Available — TypeScript 2.9, Scroll Positioning, and more
picture of the Angular repository changelog

What’s new?

Router Scroll Position Restoration
Developers can now configure the router to remember and restore scroll position as the user navigates around an application. New navigation events will reset the scroll position, and pressing the back button will restore the previous position.

Turn on restoration in the router configuration:

RouterModule.forRoot(routes, {scrollPositionRestoration: 'enabled'})

It is expected that this will become the default in a future major release.

ShadowDOM v1 View Encapsulation
There are multiple ways of connecting your CSS to the components they are defined within, we call this View Encapsulation. Within your component decorator, you can now change the View Encapsulation to use ShadowDOM v1. The previous ViewEncapsulation.Native is now deprecated.

ShadowDOM v1 has better cross-browser support than the previous version, and is being built as a shared standard across browsers.

Many of these changes apply more to library authors and advanced developers, but you can learn more about the differences between v1 and v0. ShadowDOM v1 is necessary for content projection with Angular Elements.

Select the new encapsulation in your component’s decorator:

keyvalue Pipe

It is now possible to pipe an Object through the keyvalue pipe, which will give you an array suitable for use within an *ngFor.

Schematics Chaining
We’ve improved the way that you can chain Schematics by adding support for returning a Rule from an existing Rule. This allows developers to more dynamically determine the set of rules to follow when designing Schematics.

TypeScript 2.9
Angular now supports TypeScript 2.8 and 2.9, in addition to 2.7.

One important change in TypeScript 2.9 that many developers will benefit from is related to errors such as “Exported variable ‘x’ has or is using name ‘y’ from external module ‘z’ but cannot be named”. TypeScript has relaxed these declaration emit visibility rules which means you no longer will see this error and you will no longer have to change your code for such export patterns.

For the complete list of features and bugfixes please see the Angular changelog and the CLI release notes.

This is the last planned minor for 6.x, so you should expect to see 7.0 betas released as we begin working towards the next major version.