[Angular] New in V6.1

Router Scroll Position Restoration:

remember and restore scroll position as the user navigates around an application.

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

 

ShadowDOM v1 View Encapsulation:

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.

 

@Component({
  templateUrl: './my-component.html',
  encapsulation: ViewEncapsulation.ShadowDom
})
export class MyComponent { }

 

keyvalue Pipe:

@Component({
  template: `<div *ngFor="let item of data | keyvalue">
      {{item.key}} - {{item.value}}
    </div>`
})
export class MyComponent {
  data = { "key": "value", "key2": "value2" };
}

 

posted @ 2018-07-31 22:26  Zhentiw  阅读(197)  评论(0)    收藏  举报