|
|
|
@ -2,6 +2,7 @@ import { NgIf } from '@angular/common';
|
|
|
|
|
import { Component, OnInit } from '@angular/core';
|
|
|
|
|
import { NavigationEnd, Router, RouterLink } from '@angular/router';
|
|
|
|
|
import { AddPinPopupComponent } from '../add-pin-popup/add-pin-popup.component';
|
|
|
|
|
import { LocalStorageService } from '../../services/localstorage.service';
|
|
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
|
selector: 'app-navbar',
|
|
|
|
@ -12,7 +13,10 @@ export class NavbarComponent implements OnInit {
|
|
|
|
|
isHome: boolean = false;
|
|
|
|
|
isModalOpen: boolean = false;
|
|
|
|
|
|
|
|
|
|
constructor(private router: Router) {}
|
|
|
|
|
constructor(
|
|
|
|
|
private router: Router,
|
|
|
|
|
private localStorageService: LocalStorageService
|
|
|
|
|
) {}
|
|
|
|
|
|
|
|
|
|
ngOnInit(): void {
|
|
|
|
|
this.isHome = this.router.url === '/';
|
|
|
|
@ -22,4 +26,9 @@ export class NavbarComponent implements OnInit {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public logout() {
|
|
|
|
|
this.localStorageService.removeToken();
|
|
|
|
|
this.router.navigate(['/']);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|