Remove mobile-dropdown when navigation start from container.
This commit is contained in:
parent
056faac88f
commit
0a56d1fae6
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue