Files
docs.nestjs.com/src/app/app.component.ts
kamil.mysliwiec 35518da691 Initial commit
2017-08-26 10:12:55 +02:00

17 lines
500 B
TypeScript

import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core';
import { Router, NavigationEnd } from '@angular/router';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
changeDetection: ChangeDetectionStrategy.OnPush
})
export class AppComponent implements OnInit {
constructor(private readonly router: Router) { }
ngOnInit() {
this.router.events
.filter((ev) => ev instanceof NavigationEnd)
.subscribe(() => window.scroll(0, 0));
}
}