import { NgModule } from '@angular/core' ; import { Routes , RouterModule } from '@angular/router' ; import { RouterGuardService } from './services/core/router-guard.service' ; import { BackstageTopbannerComponent } from './layouts/backstage-topbanner/backstage-topbanner.component' ; const routes = [ { path : 'frontstage' , loadChildren : ( ) => import ( './pages/frontstage/frontstage.module' ) . then ( m => m . FrontStageModule ) , } , { path : 'account' , loadChildren : ( ) => import ( './pages/account/account.module' ) . then ( m => m . AccountModule ) , } , { path : '' , component : BackstageTopbannerComponent , canActivate : [ RouterGuardService ] , children : [ { path : '' , redirectTo : 'system/home' , pathMatch : 'full' } , { path : 'examples' , loadChildren : ( ) => import ( './pages/backstage/examples/examples.module' ) . then ( m => m . ExamplesModule ) } , { path : 'system' , loadChildren : ( ) => import ( './pages/backstage/system/system.module' ) . then ( m => m . SystemModule ) } , { path : 'exception' , loadChildren : ( ) => import ( './pages/commons/exception/exception.module' ) . then ( m => m . ExceptionModule ) } , ] } , { path : '**' , redirectTo : 'exception/404' } ] ; @ NgModule ( { imports : [ RouterModule . forRoot ( routes , { useHash : true } ) ] , exports : [ RouterModule ] } ) export class AppRoutingModule { }