Merge pull request #761 from Cucumberrbob/fix/close-mobile-menu-on-navigation
fix: close mobile menu after navigating
This commit is contained in:
commit
83cd14f807
1 changed files with 8 additions and 2 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { Router } from '@angular/router';
|
import {NavigationEnd, Router} from '@angular/router';
|
||||||
import { AuthService } from '../auth.service';
|
import { AuthService } from '../auth.service';
|
||||||
import { Profile } from '../models/profile.model';
|
import { Profile } from '../models/profile.model';
|
||||||
import { SettingsService } from '../settings.service';
|
import { SettingsService } from '../settings.service';
|
||||||
|
|
@ -20,7 +20,13 @@ export class NavbarComponent implements OnInit {
|
||||||
private settingsService: SettingsService,
|
private settingsService: SettingsService,
|
||||||
private authService: AuthService,
|
private authService: AuthService,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
) {}
|
) {
|
||||||
|
this.router.events.subscribe(event => {
|
||||||
|
if (event instanceof NavigationEnd) {
|
||||||
|
this.showMobileMenu = false;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.settingsService.getProfile().subscribe((result) => {
|
this.settingsService.getProfile().subscribe((result) => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue