fix(login): fix navigation error

This commit is contained in:
nixa 2016-06-16 16:15:19 +03:00
parent 3ec1fc3304
commit b4b22de324
2 changed files with 11 additions and 3 deletions

View file

@ -107,7 +107,7 @@ export const menuItems = [
},
{
title: 'Pages',
icon: 'ion-ios-location-outline',
icon: 'ion-document',
selected: false,
expanded: false,
order: 650,

View file

@ -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();
}