mirror of
https://github.com/nestjs/docs.nestjs.com.git
synced 2026-02-21 20:31:32 +00:00
17 lines
500 B
TypeScript
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));
|
|
}
|
|
} |