1import { DOCUMENT } from '@angular/common';
2import { Component, Inject } from '@angular/core';
3
4@Component({
5 selector: 'app-refresh-banner-notification',
6 templateUrl: './refresh-banner-notification.component.html',
7 styleUrls: ['./refresh-banner-notification.component.scss']
8})
9
10export class RefreshBannerNotificationComponent {
11
12 constructor(
13 @Inject(DOCUMENT) private _document: Document
14 ) {}
15
16 refreshPage() {
17 this._document.defaultView.location.reload();
18 }
19}
1this.router.routeReuseStrategy.shouldReuseRoute = function(){
2 return false;
3 };
4this.router.events.subscribe((evt) => {
5 if (evt instanceof NavigationEnd) {
6 // trick the Router into believing it's last link wasn't previously loaded
7 this.router.navigated = false;
8 // if you need to scroll back to top, here is the right place
9 window.scrollTo(0, 0);
10 }
11 });