]>
Commit | Line | Data |
---|---|---|
1 | import { NgModule } from '@angular/core' | |
2 | import { RouterModule, Routes, UrlSegment } from '@angular/router' | |
3 | import { VideoLocalComponent } from '@app/videos/video-list/video-local.component' | |
4 | import { MetaGuard } from '@ngx-meta/core' | |
5 | import { VideoSearchComponent } from './video-list' | |
6 | import { VideoRecentlyAddedComponent } from './video-list/video-recently-added.component' | |
7 | import { VideoTrendingComponent } from './video-list/video-trending.component' | |
8 | import { VideosComponent } from './videos.component' | |
9 | ||
10 | const videosRoutes: Routes = [ | |
11 | { | |
12 | path: 'videos', | |
13 | component: VideosComponent, | |
14 | canActivateChild: [ MetaGuard ], | |
15 | children: [ | |
16 | { | |
17 | path: 'list', | |
18 | pathMatch: 'full', | |
19 | redirectTo: 'recently-added' | |
20 | }, | |
21 | { | |
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, | |
33 | data: { | |
34 | meta: { | |
35 | title: 'Recently added videos' | |
36 | } | |
37 | } | |
38 | }, | |
39 | { | |
40 | path: 'local', | |
41 | component: VideoLocalComponent, | |
42 | data: { | |
43 | meta: { | |
44 | title: 'Local videos' | |
45 | } | |
46 | } | |
47 | }, | |
48 | { | |
49 | path: 'search', | |
50 | component: VideoSearchComponent, | |
51 | data: { | |
52 | meta: { | |
53 | title: 'Search videos' | |
54 | } | |
55 | } | |
56 | }, | |
57 | { | |
58 | path: 'upload', | |
59 | loadChildren: 'app/videos/+video-edit/video-add.module#VideoAddModule', | |
60 | data: { | |
61 | meta: { | |
62 | title: 'Upload a video' | |
63 | } | |
64 | } | |
65 | }, | |
66 | { | |
67 | path: 'update/:uuid', | |
68 | loadChildren: 'app/videos/+video-edit/video-update.module#VideoUpdateModule', | |
69 | data: { | |
70 | meta: { | |
71 | title: 'Edit a video' | |
72 | } | |
73 | } | |
74 | }, | |
75 | { | |
76 | path: 'watch/:uuid', | |
77 | loadChildren: 'app/videos/+video-watch/video-watch.module#VideoWatchModule', | |
78 | data: { | |
79 | preload: 3000 | |
80 | } | |
81 | } | |
82 | ] | |
83 | } | |
84 | ] | |
85 | ||
86 | @NgModule({ | |
87 | imports: [ RouterModule.forChild(videosRoutes) ], | |
88 | exports: [ RouterModule ] | |
89 | }) | |
90 | export class VideosRoutingModule {} |