]>
Commit | Line | Data |
---|---|---|
df98563e | 1 | import { NgModule } from '@angular/core' |
57c36b27 | 2 | import { RouterModule, Routes } from '@angular/router' |
066e94c5 | 3 | import { VideoLocalComponent } from '@app/videos/video-list/video-local.component' |
8b13c289 | 4 | import { MetaGuard } from '@ngx-meta/core' |
9bf9d2a5 C |
5 | import { VideoRecentlyAddedComponent } from './video-list/video-recently-added.component' |
6 | import { VideoTrendingComponent } from './video-list/video-trending.component' | |
df98563e | 7 | import { VideosComponent } from './videos.component' |
0629423c | 8 | |
693b1aba | 9 | const videosRoutes: Routes = [ |
0629423c C |
10 | { |
11 | path: 'videos', | |
12 | component: VideosComponent, | |
8b13c289 | 13 | canActivateChild: [ MetaGuard ], |
0629423c | 14 | children: [ |
9bf9d2a5 C |
15 | { |
16 | path: 'list', | |
17 | pathMatch: 'full', | |
18 | redirectTo: 'recently-added' | |
19 | }, | |
0629423c | 20 | { |
9bf9d2a5 C |
21 | path: 'trending', |
22 | component: VideoTrendingComponent, | |
23 | data: { | |
24 | meta: { | |
25 | title: 'Trending videos' | |
26 | } | |
27 | } | |
28 | }, | |
29 | { | |
30 | path: 'recently-added', | |
31 | component: VideoRecentlyAddedComponent, | |
b58c69a1 C |
32 | data: { |
33 | meta: { | |
9bf9d2a5 | 34 | title: 'Recently added videos' |
b58c69a1 C |
35 | } |
36 | } | |
0629423c | 37 | }, |
066e94c5 C |
38 | { |
39 | path: 'local', | |
40 | component: VideoLocalComponent, | |
41 | data: { | |
42 | meta: { | |
43 | title: 'Local videos' | |
44 | } | |
45 | } | |
46 | }, | |
0629423c | 47 | { |
f47bf2e1 | 48 | path: 'upload', |
63c4db6d | 49 | loadChildren: 'app/videos/+video-edit/video-add.module#VideoAddModule', |
b58c69a1 C |
50 | data: { |
51 | meta: { | |
f47bf2e1 | 52 | title: 'Upload a video' |
b58c69a1 C |
53 | } |
54 | } | |
0629423c | 55 | }, |
d8e689b8 | 56 | { |
c663955b | 57 | path: 'update/:uuid', |
63c4db6d | 58 | loadChildren: 'app/videos/+video-edit/video-update.module#VideoUpdateModule', |
d8e689b8 C |
59 | data: { |
60 | meta: { | |
61 | title: 'Edit a video' | |
62 | } | |
63 | } | |
64 | }, | |
91219e66 C |
65 | { |
66 | path: 'watch/:uuid/comments/:commentId', | |
67 | redirectTo: 'watch/:uuid' | |
68 | }, | |
0629423c | 69 | { |
0a6658fd | 70 | path: 'watch/:uuid', |
63c4db6d | 71 | loadChildren: 'app/videos/+video-watch/video-watch.module#VideoWatchModule', |
a685e25c C |
72 | data: { |
73 | preload: 3000 | |
74 | } | |
0629423c C |
75 | } |
76 | ] | |
77 | } | |
df98563e | 78 | ] |
693b1aba C |
79 | |
80 | @NgModule({ | |
81 | imports: [ RouterModule.forChild(videosRoutes) ], | |
82 | exports: [ RouterModule ] | |
83 | }) | |
84 | export class VideosRoutingModule {} |