1 import { NgModule } from '@angular/core'
2 import { RouteReuseStrategy, RouterModule, Routes } from '@angular/router'
4 import { PreloadSelectedModulesList } from './core'
5 import { AppComponent } from '@app/app.component'
6 import { CustomReuseStrategy } from '@app/core/routing/custom-reuse-strategy'
7 import { MenuGuards } from '@app/core/routing/menu-guard.service'
9 const routes: Routes = [
12 canActivate: [ MenuGuards.close() ],
13 canDeactivate: [ MenuGuards.open() ],
14 loadChildren: () => import('./+admin/admin.module').then(m => m.AdminModule)
18 loadChildren: () => import('./+my-account/my-account.module').then(m => m.MyAccountModule)
21 path: 'verify-account',
22 loadChildren: () => import('./+signup/+verify-account/verify-account.module').then(m => m.VerifyAccountModule)
26 loadChildren: () => import('./+accounts/accounts.module').then(m => m.AccountsModule)
29 path: 'video-channels',
30 loadChildren: () => import('./+video-channels/video-channels.module').then(m => m.VideoChannelsModule)
34 loadChildren: () => import('./+about/about.module').then(m => m.AboutModule)
38 loadChildren: () => import('./+signup/+register/register.module').then(m => m.RegisterModule)
42 component: AppComponent // Avoid 404, app component will redirect dynamically
46 loadChildren: () => import('./+page-not-found/page-not-found.module').then(m => m.PageNotFoundModule)
52 RouterModule.forRoot(routes, {
53 useHash: Boolean(history.pushState) === false,
54 scrollPositionRestoration: 'disabled',
55 preloadingStrategy: PreloadSelectedModulesList,
56 anchorScrolling: 'disabled'
61 PreloadSelectedModulesList,
62 { provide: RouteReuseStrategy, useClass: CustomReuseStrategy }
64 exports: [ RouterModule ]
66 export class AppRoutingModule {}