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