diff --git a/utils/mobile-dropdown/mobile-dropdown.component.ts b/utils/mobile-dropdown/mobile-dropdown.component.ts index b913cd8b..f1b3c2ef 100644 --- a/utils/mobile-dropdown/mobile-dropdown.component.ts +++ b/utils/mobile-dropdown/mobile-dropdown.component.ts @@ -1,4 +1,5 @@ import {Component, ElementRef, EventEmitter, Input, OnInit, Output} from "@angular/core"; +import {NavigationStart, Router} from "@angular/router"; @Component({ selector: 'mobile-dropdown', @@ -20,7 +21,12 @@ export class MobileDropdownComponent implements OnInit{ public opened: boolean = false; private static MOBILE_DROPDOWN_CONTAINER = 'mobile-dropdown-container'; - constructor(private element: ElementRef) { + constructor(private element: ElementRef, private router: Router) { + this.router.events.subscribe(event => { + if(event instanceof NavigationStart) { + this.element.nativeElement.remove(); + } + }); } ngOnInit() {