diff --git a/sharedComponents/navigationBar.component.html b/sharedComponents/navigationBar.component.html index 0a7750ab..15dc698d 100644 --- a/sharedComponents/navigationBar.component.html +++ b/sharedComponents/navigationBar.component.html @@ -74,7 +74,7 @@ -
  • +
  • Home
  • -->
      -
    • +
    • Home
    • diff --git a/sharedComponents/navigationBar.component.ts b/sharedComponents/navigationBar.component.ts index c72464e9..5715aae6 100644 --- a/sharedComponents/navigationBar.component.ts +++ b/sharedComponents/navigationBar.component.ts @@ -147,6 +147,13 @@ export class NavigationBarComponent implements OnInit, OnDestroy { console.error('NavigationBar (component): ' + message, error); } + get currentRoute() { + return { + route: this.router.url.split('?')[0].split('#')[0], + fragment: this.route.snapshot.fragment + } + } + isTheActiveMenu(menu: RootMenuItem): boolean { if (!menu.rootItem.markAsActive) { return false; @@ -164,10 +171,7 @@ export class NavigationBarComponent implements OnInit, OnDestroy { } isTheActiveMenuItem(menuItem: MenuItem): boolean { - let currentRoute = { - route: this.router.url.split('?')[0].split('#')[0], - fragment: this.route.snapshot.fragment - }; + let currentRoute = this.currentRoute; return (menuItem.route == currentRoute.route || menuItem.route == (currentRoute.route + "/")) && currentRoute.fragment == menuItem.fragment; }