diff --git a/client/src/app/navbar/navbar.component.ts b/client/src/app/navbar/navbar.component.ts index 17530e3..58c905d 100644 --- a/client/src/app/navbar/navbar.component.ts +++ b/client/src/app/navbar/navbar.component.ts @@ -1,5 +1,5 @@ import { Component, OnInit } from '@angular/core'; -import { Router } from '@angular/router'; +import {NavigationEnd, Router} from '@angular/router'; import { AuthService } from '../auth.service'; import { Profile } from '../models/profile.model'; import { SettingsService } from '../settings.service'; @@ -20,7 +20,13 @@ export class NavbarComponent implements OnInit { private settingsService: SettingsService, private authService: AuthService, private router: Router, - ) {} + ) { + this.router.events.subscribe(event => { + if (event instanceof NavigationEnd) { + this.showMobileMenu = false; + } + }) + } ngOnInit(): void { this.settingsService.getProfile().subscribe((result) => {