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