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'
8 const routes: Routes = [
11 loadChildren: './+admin/admin.module#AdminModule'
15 loadChildren: './+my-account/my-account.module#MyAccountModule'
18 path: 'verify-account',
19 loadChildren: './+verify-account/verify-account.module#VerifyAccountModule'
23 loadChildren: './+accounts/accounts.module#AccountsModule'
26 path: 'video-channels',
27 loadChildren: './+video-channels/video-channels.module#VideoChannelsModule'
31 loadChildren: './+about/about.module#AboutModule'
35 component: AppComponent // Avoid 404, app component will redirect dynamically
39 loadChildren: './+page-not-found/page-not-found.module#PageNotFoundModule'
45 RouterModule.forRoot(routes, {
46 useHash: Boolean(history.pushState) === false,
47 scrollPositionRestoration: 'disabled',
48 preloadingStrategy: PreloadSelectedModulesList,
49 anchorScrolling: 'disabled'
53 PreloadSelectedModulesList,
54 { provide: RouteReuseStrategy, useClass: CustomReuseStrategy }
56 exports: [ RouterModule ]
58 export class AppRoutingModule {}