diff --git a/client/src/app/app-routing.module.ts b/client/src/app/app-routing.module.ts index b5a677d15..a87f4ce1b 100644 --- a/client/src/app/app-routing.module.ts +++ b/client/src/app/app-routing.module.ts @@ -4,10 +4,13 @@ import { RouteReuseStrategy, RouterModule, Routes } from '@angular/router' import { PreloadSelectedModulesList } from './core' import { AppComponent } from '@app/app.component' import { CustomReuseStrategy } from '@app/core/routing/custom-reuse-strategy' +import { MenuGuards } from '@app/core/routing/menu-guard.service' const routes: Routes = [ { path: 'admin', + canActivate: [ MenuGuards.close() ], + canDeactivate: [ MenuGuards.open() ], loadChildren: () => import('./+admin/admin.module').then(m => m.AdminModule) }, { @@ -54,6 +57,7 @@ const routes: Routes = [ }) ], providers: [ + MenuGuards.guards, PreloadSelectedModulesList, { provide: RouteReuseStrategy, useClass: CustomReuseStrategy } ], diff --git a/client/src/app/app.component.html b/client/src/app/app.component.html index 54b320f79..d5fec61e6 100644 --- a/client/src/app/app.component.html +++ b/client/src/app/app.component.html @@ -5,8 +5,8 @@