mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-28 21:28:50 +01:00
fix(login): fix navigation error
This commit is contained in:
parent
3ec1fc3304
commit
b4b22de324
2 changed files with 11 additions and 3 deletions
|
|
@ -107,7 +107,7 @@ export const menuItems = [
|
|||
},
|
||||
{
|
||||
title: 'Pages',
|
||||
icon: 'ion-ios-location-outline',
|
||||
icon: 'ion-document',
|
||||
selected: false,
|
||||
expanded: false,
|
||||
order: 650,
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue