1 import { NgModule } from '@angular/core'
2 import { RouteReuseStrategy, RouterModule, Routes } from '@angular/router'
3 import { AppComponent } from '@app/app.component'
4 import { CustomReuseStrategy } from '@app/core/routing/custom-reuse-strategy'
5 import { MenuGuards } from '@app/core/routing/menu-guard.service'
6 import { PreloadSelectedModulesList } from './core'
8 const routes: Routes = [
11 canActivate: [ MenuGuards.close() ],
12 canDeactivate: [ MenuGuards.open() ],
13 loadChildren: () => import('./+admin/admin.module').then(m => m.AdminModule)
17 loadChildren: () => import('./+my-account/my-account.module').then(m => m.MyAccountModule)
20 path: 'verify-account',
21 loadChildren: () => import('./+signup/+verify-account/verify-account.module').then(m => m.VerifyAccountModule)
25 loadChildren: () => import('./+accounts/accounts.module').then(m => m.AccountsModule)
28 path: 'video-channels',
29 loadChildren: () => import('./+video-channels/video-channels.module').then(m => m.VideoChannelsModule)
33 loadChildren: () => import('./+about/about.module').then(m => m.AboutModule)
37 loadChildren: () => import('./+signup/+register/register.module').then(m => m.RegisterModule)
41 component: AppComponent // Avoid 404, app component will redirect dynamically
45 loadChildren: () => import('./+page-not-found/page-not-found.module').then(m => m.PageNotFoundModule)
51 RouterModule.forRoot(routes, {
52 useHash: Boolean(history.pushState) === false,
53 scrollPositionRestoration: 'disabled',
54 preloadingStrategy: PreloadSelectedModulesList,
55 anchorScrolling: 'disabled'
60 PreloadSelectedModulesList,
61 { provide: RouteReuseStrategy, useClass: CustomReuseStrategy }
63 exports: [ RouterModule ]
65 export class AppRoutingModule {}