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