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