This project was generated with Angular CLI version 6.0.7.
Run ng serve
for a dev server. Navigate to http://localhost:4200/
. The app will automatically reload if you change any of the source files.
New keyvalue pipe
@Component({
selector: "app-keyvalue",
template: `
<h1>Keyvalue component</h1>
<div *ngFor="let item of person | keyvalue">
{{ item.key }} - {{ item.value }}
</div>
`
})
export class KeyvalueComponent {
person = {
firstname: "Quentin",
lastname: "Monmert"
};
}
This example renders :
firstname - Quentin
lastname - Monmert
Restore the scroll position when going back. Feature by default in the future
RouterModule.forRoot(routes, {
scrollPositionRestoration: "enabled"
})
New view encapsulation : ViewEncapsulation.ShadowDom
@Component({
selector: "app-encapsulation",
template: `
<style>
h1 {
color: lightcoral;
}
</style>
<h1>Encapsulation component</h1>
`,
encapsulation: ViewEncapsulation.ShadowDom // ShadowDOM v1
})
export class EncapsulationComponent {}