From 58219dca8e00b46917730a1fd7f403ab75244ce4 Mon Sep 17 00:00:00 2001 From: Gal Tetinger Date: Sun, 17 Jul 2016 19:41:00 +0300 Subject: [PATCH] fixing navigation issue - creating deep copy of routes before working on it. https://github.com/akveo/ng2-admin/issues/93 --- src/app/theme/components/baSidebar/baSidebar.component.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/theme/components/baSidebar/baSidebar.component.ts b/src/app/theme/components/baSidebar/baSidebar.component.ts index c8825733..c6376c38 100644 --- a/src/app/theme/components/baSidebar/baSidebar.component.ts +++ b/src/app/theme/components/baSidebar/baSidebar.component.ts @@ -3,6 +3,7 @@ import {AppState} from '../../../app.state'; import {layoutSizes} from '../../../theme'; import {BaMenu} from '../baMenu'; import {routes} from '../../../../app/app.routes'; +import * as _ from 'lodash'; @Component({ selector: 'ba-sidebar', @@ -15,7 +16,7 @@ import {routes} from '../../../../app/app.routes'; export class BaSidebar { // here we declare which routes we want to use as a menu in our sidebar - public routes = routes; + public routes = _.cloneDeep(routes); // we're creating a deep copy since we are going to change that object public menuHeight:number; public isMenuCollapsed:boolean = false;