From b4b22de3248afd0a9d762da899ff464051f5d498 Mon Sep 17 00:00:00 2001 From: nixa <4dmitr@gmail.com> Date: Thu, 16 Jun 2016 16:15:19 +0300 Subject: [PATCH] fix(login): fix navigation error --- src/app/app.menu.ts | 2 +- .../components/baSidebar/baSidebar.component.ts | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/app/app.menu.ts b/src/app/app.menu.ts index a2ca736a..374f3dac 100644 --- a/src/app/app.menu.ts +++ b/src/app/app.menu.ts @@ -107,7 +107,7 @@ export const menuItems = [ }, { title: 'Pages', - icon: 'ion-ios-location-outline', + icon: 'ion-document', selected: false, expanded: false, order: 650, diff --git a/src/app/theme/components/baSidebar/baSidebar.component.ts b/src/app/theme/components/baSidebar/baSidebar.component.ts index cfc48527..1dd572c3 100644 --- a/src/app/theme/components/baSidebar/baSidebar.component.ts +++ b/src/app/theme/components/baSidebar/baSidebar.component.ts @@ -27,6 +27,7 @@ export class BaSidebar { public outOfArea:number = -200; public isMenuShouldCollapsed:boolean = false; + protected _onRouteChange; constructor(private _elementRef:ElementRef, private _router:Router, @@ -34,16 +35,23 @@ export class BaSidebar { private _state:AppState) { this.menuItems = this._sidebarService.getMenuItems(); - this._router.root.subscribe((path) => this._selectMenuItem(path)); - this._state.subscribe('menu.isCollapsed', (isCollapsed) => { this.isMenuCollapsed = isCollapsed; }); + this._onRouteChange = this._router.root.subscribe((path) => this._selectMenuItem(path)); + this._state.subscribe('menu.isCollapsed', (isCollapsed) => { + this.isMenuCollapsed = isCollapsed; + }); } + public ngOnInit():void { if (this._shouldMenuCollapse()) { this.menuCollapse(); } } + public ngOnDestroy():void { + this._onRouteChange.unsubscribe(); + } + public ngAfterViewInit():void { this.updateSidebarHeight(); }