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