]>
Commit | Line | Data |
---|---|---|
df98563e | 1 | import { NgModule } from '@angular/core' |
489290b8 | 2 | import { RouteReuseStrategy, RouterModule, Routes } from '@angular/router' |
a685e25c C |
3 | |
4 | import { PreloadSelectedModulesList } from './core' | |
b889cdb2 | 5 | import { AppComponent } from '@app/app.component' |
489290b8 | 6 | import { CustomReuseStrategy } from '@app/core/routing/custom-reuse-strategy' |
693b1aba C |
7 | |
8 | const routes: Routes = [ | |
4b4f22fc C |
9 | { |
10 | path: 'admin', | |
f36da21e | 11 | loadChildren: () => import('./+admin/admin.module').then(m => m.AdminModule) |
4b4f22fc C |
12 | }, |
13 | { | |
14 | path: 'my-account', | |
f36da21e | 15 | loadChildren: () => import('./+my-account/my-account.module').then(m => m.MyAccountModule) |
4b4f22fc | 16 | }, |
d9eaee39 JM |
17 | { |
18 | path: 'verify-account', | |
f36da21e | 19 | loadChildren: () => import('./+signup/+verify-account/verify-account.module').then(m => m.VerifyAccountModule) |
d9eaee39 | 20 | }, |
4b4f22fc C |
21 | { |
22 | path: 'accounts', | |
f36da21e | 23 | loadChildren: () => import('./+accounts/accounts.module').then(m => m.AccountsModule) |
4b4f22fc C |
24 | }, |
25 | { | |
26 | path: 'video-channels', | |
f36da21e | 27 | loadChildren: () => import('./+video-channels/video-channels.module').then(m => m.VideoChannelsModule) |
a51bad1a | 28 | }, |
78f912ed C |
29 | { |
30 | path: 'about', | |
f36da21e | 31 | loadChildren: () => import('./+about/about.module').then(m => m.AboutModule) |
78f912ed | 32 | }, |
b247a132 C |
33 | { |
34 | path: 'signup', | |
f36da21e | 35 | loadChildren: () => import('./+signup/+register/register.module').then(m => m.RegisterModule) |
b247a132 | 36 | }, |
b889cdb2 C |
37 | { |
38 | path: '', | |
39 | component: AppComponent // Avoid 404, app component will redirect dynamically | |
40 | }, | |
a51bad1a C |
41 | { |
42 | path: '**', | |
f36da21e | 43 | loadChildren: () => import('./+page-not-found/page-not-found.module').then(m => m.PageNotFoundModule) |
4b4f22fc | 44 | } |
df98563e | 45 | ] |
693b1aba C |
46 | |
47 | @NgModule({ | |
04de542a C |
48 | imports: [ |
49 | RouterModule.forRoot(routes, { | |
50 | useHash: Boolean(history.pushState) === false, | |
489290b8 | 51 | scrollPositionRestoration: 'disabled', |
07a98236 | 52 | preloadingStrategy: PreloadSelectedModulesList, |
489290b8 | 53 | anchorScrolling: 'disabled' |
04de542a C |
54 | }) |
55 | ], | |
901637bb | 56 | providers: [ |
489290b8 C |
57 | PreloadSelectedModulesList, |
58 | { provide: RouteReuseStrategy, useClass: CustomReuseStrategy } | |
901637bb | 59 | ], |
693b1aba C |
60 | exports: [ RouterModule ] |
61 | }) | |
62 | export class AppRoutingModule {} |