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