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'
7 import { EmptyComponent } from './empty.component'
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)
41 path: 'reset-password',
42 loadChildren: () => import('./+reset-password/reset-password.module').then(m => m.ResetPasswordModule)
46 loadChildren: () => import('./+login/login.module').then(m => m.LoginModule)
50 loadChildren: () => import('./+search/search.module').then(m => m.SearchModule)
54 loadChildren: () => import('./+videos/videos.module').then(m => m.VideosModule)
58 component: EmptyComponent // Avoid 404, app component will redirect dynamically
62 loadChildren: () => import('./+page-not-found/page-not-found.module').then(m => m.PageNotFoundModule)
68 RouterModule.forRoot(routes, {
69 useHash: Boolean(history.pushState) === false,
70 scrollPositionRestoration: 'disabled',
71 preloadingStrategy: PreloadSelectedModulesList,
72 anchorScrolling: 'disabled'
77 PreloadSelectedModulesList,
78 { provide: RouteReuseStrategy, useClass: CustomReuseStrategy }
80 exports: [ RouterModule ]
82 export class AppRoutingModule {}