diff --git a/src/app/app.component.ts b/src/app/app.component.ts index f071ed2e..d68cb3de 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -6,6 +6,7 @@ import { environment } from '../environments/environment'; import { Theme } from './core/enums/theme.enum'; import { LanguageService } from './core/services/language.service'; import { ThemeService } from './core/services/theme.service'; +import { NavigationEnd, Router } from '@angular/router'; @Component({ selector: 'app-root', @@ -21,12 +22,20 @@ export class AppComponent implements OnInit, OnDestroy { private themeSubscription: Subscription; constructor( + private router: Router, private titleService: Title, private themeService: ThemeService, private languageService: LanguageService // private mockingService: MockingService ) {} ngOnInit(): void { + this.router.events.subscribe((evt) => { + if (!(evt instanceof NavigationEnd)) { + return; + } + window.scrollTo(0, 0); + }); + if (!environment.production) { this.appTitle += ' [DEV]'; }