[MonitorDashboard]: Fix a bug on app component

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-monitor-portal/trunk/monitor_dashboard@57847 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
Konstantinos Triantafyllou 2019-12-09 15:20:23 +00:00
parent c5229ca8fb
commit 7e2704fcfe
1 changed files with 80 additions and 79 deletions

View File

@ -1,5 +1,5 @@
import {ChangeDetectorRef, Component, OnDestroy, OnInit} from '@angular/core'; import {ChangeDetectorRef, Component, OnDestroy, OnInit} from '@angular/core';
import {ActivatedRoute, NavigationEnd, Router} from '@angular/router'; import {ActivatedRoute, NavigationEnd, RouteConfigLoadEnd, Router} from '@angular/router';
import {EnvProperties} from './openaireLibrary/utils/properties/env-properties'; import {EnvProperties} from './openaireLibrary/utils/properties/env-properties';
import {EnvironmentSpecificService} from './openaireLibrary/utils/properties/environment-specific.service'; import {EnvironmentSpecificService} from './openaireLibrary/utils/properties/environment-specific.service';
@ -44,7 +44,8 @@ export class AppComponent implements OnInit, OnDestroy {
.then(properties => { .then(properties => {
this.properties = properties; this.properties = properties;
this.router.events.subscribe(event => { this.router.events.subscribe(event => {
if (event instanceof NavigationEnd) { if (event instanceof RouteConfigLoadEnd && event.route.path.indexOf('stakeholder') !== -1 ||
event instanceof NavigationEnd) {
let r = this.route; let r = this.route;
while (r.firstChild) { while (r.firstChild) {
r = r.firstChild; r = r.firstChild;