diff --git a/web-ui/src/app/components/navbar/navbar.component.html b/web-ui/src/app/components/navbar/navbar.component.html index 387751c..cc1d5c5 100644 --- a/web-ui/src/app/components/navbar/navbar.component.html +++ b/web-ui/src/app/components/navbar/navbar.component.html @@ -1,3 +1,17 @@ -
- navbar works! -
+ diff --git a/web-ui/src/app/components/navbar/navbar.component.ts b/web-ui/src/app/components/navbar/navbar.component.ts index 8e29f4e..ad7b58c 100644 --- a/web-ui/src/app/components/navbar/navbar.component.ts +++ b/web-ui/src/app/components/navbar/navbar.component.ts @@ -1,4 +1,5 @@ import { Component, OnInit } from '@angular/core'; +import { Location } from '@angular/common'; @Component({ selector: 'app-navbar', @@ -7,9 +8,19 @@ import { Component, OnInit } from '@angular/core'; }) export class NavbarComponent implements OnInit { - constructor() { } + public tabs = []; + + constructor(private location: Location) { } ngOnInit() { } + /* tabs */ + isSelected(path: string): boolean { + if (!path.startsWith('/')) { + path = '/' + path; + } + + return this.location.isCurrentPathEqualTo(path); + } }