1 import {Component} from '@angular/core';
2 import {Router, NavigationEnd} from '@angular/router';
3 import {DialogComponent} from '@eg/share/dialog/dialog.component';
7 template: '<router-outlet></router-outlet>'
10 export class BaseComponent {
12 constructor(private router: Router) {
13 this.router.events.subscribe(routeEvent => {
14 if (routeEvent instanceof NavigationEnd) {
15 // Prevent dialogs from persisting across navigation.
16 DialogComponent.closeAll();