]>
Commit | Line | Data |
---|---|---|
df98563e C |
1 | import { NgModule } from '@angular/core' |
2 | import { RouterModule, Routes } from '@angular/router' | |
0629423c | 3 | |
8b13c289 C |
4 | import { MetaGuard } from '@ngx-meta/core' |
5 | ||
df98563e C |
6 | import { VideoAddComponent, VideoUpdateComponent } from './video-edit' |
7 | import { VideoListComponent } from './video-list' | |
8 | import { VideosComponent } from './videos.component' | |
9 | import { VideoWatchComponent } from './video-watch' | |
0629423c | 10 | |
693b1aba | 11 | const videosRoutes: Routes = [ |
0629423c C |
12 | { |
13 | path: 'videos', | |
14 | component: VideosComponent, | |
8b13c289 | 15 | canActivateChild: [ MetaGuard ], |
0629423c C |
16 | children: [ |
17 | { | |
18 | path: 'list', | |
b58c69a1 C |
19 | component: VideoListComponent, |
20 | data: { | |
21 | meta: { | |
55b33946 | 22 | title: 'Videos list' |
b58c69a1 C |
23 | } |
24 | } | |
0629423c C |
25 | }, |
26 | { | |
27 | path: 'add', | |
b58c69a1 C |
28 | component: VideoAddComponent, |
29 | data: { | |
30 | meta: { | |
55b33946 | 31 | title: 'Add a video' |
b58c69a1 C |
32 | } |
33 | } | |
0629423c | 34 | }, |
d8e689b8 | 35 | { |
0a6658fd | 36 | path: 'edit/:uuid', |
d8e689b8 C |
37 | component: VideoUpdateComponent, |
38 | data: { | |
39 | meta: { | |
40 | title: 'Edit a video' | |
41 | } | |
42 | } | |
43 | }, | |
da19d94b | 44 | { |
0a6658fd C |
45 | path: ':uuid', |
46 | redirectTo: 'watch/:uuid' | |
da19d94b | 47 | }, |
0629423c | 48 | { |
0a6658fd | 49 | path: 'watch/:uuid', |
0629423c C |
50 | component: VideoWatchComponent |
51 | } | |
52 | ] | |
53 | } | |
df98563e | 54 | ] |
693b1aba C |
55 | |
56 | @NgModule({ | |
57 | imports: [ RouterModule.forChild(videosRoutes) ], | |
58 | exports: [ RouterModule ] | |
59 | }) | |
60 | export class VideosRoutingModule {} |