import { Component, OnInit } from '@angular/core'; import { AuthService } from '../shared/services/auth.service'; @Component({ selector: 'app-nav-menu', templateUrl: './nav-menu.component.html', styleUrls: ['./nav-menu.component.css'] }) export class NavMenuComponent implements OnInit { isExpanded = false; loggedIn: boolean = false; constructor(private authService: AuthService) { } ngOnInit(): void { if(localStorage.getItem('access_token')) { this.loggedIn = true; } } logout() { this.authService.logout(); } collapse() { this.isExpanded = false; } toggle() { this.isExpanded = !this.isExpanded; } }