]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame_incremental - client/src/app/app-routing.module.ts
Multi step registration
[github/Chocobozzz/PeerTube.git] / client / src / app / app-routing.module.ts
... / ...
CommitLineData
1import { NgModule } from '@angular/core'
2import { RouteReuseStrategy, RouterModule, Routes } from '@angular/router'
3
4import { PreloadSelectedModulesList } from './core'
5import { AppComponent } from '@app/app.component'
6import { CustomReuseStrategy } from '@app/core/routing/custom-reuse-strategy'
7
8const routes: Routes = [
9 {
10 path: 'admin',
11 loadChildren: './+admin/admin.module#AdminModule'
12 },
13 {
14 path: 'my-account',
15 loadChildren: './+my-account/my-account.module#MyAccountModule'
16 },
17 {
18 path: 'verify-account',
19 loadChildren: './+verify-account/verify-account.module#VerifyAccountModule'
20 },
21 {
22 path: 'accounts',
23 loadChildren: './+accounts/accounts.module#AccountsModule'
24 },
25 {
26 path: 'video-channels',
27 loadChildren: './+video-channels/video-channels.module#VideoChannelsModule'
28 },
29 {
30 path: 'about',
31 loadChildren: './+about/about.module#AboutModule'
32 },
33 {
34 path: '',
35 component: AppComponent // Avoid 404, app component will redirect dynamically
36 },
37 {
38 path: '**',
39 loadChildren: './+page-not-found/page-not-found.module#PageNotFoundModule'
40 }
41]
42
43@NgModule({
44 imports: [
45 RouterModule.forRoot(routes, {
46 useHash: Boolean(history.pushState) === false,
47 scrollPositionRestoration: 'disabled',
48 preloadingStrategy: PreloadSelectedModulesList,
49 anchorScrolling: 'disabled'
50 })
51 ],
52 providers: [
53 PreloadSelectedModulesList,
54 { provide: RouteReuseStrategy, useClass: CustomReuseStrategy }
55 ],
56 exports: [ RouterModule ]
57})
58export class AppRoutingModule {}