]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame_incremental - client/src/app/videos/videos-routing.module.ts
Improve real world script
[github/Chocobozzz/PeerTube.git] / client / src / app / videos / videos-routing.module.ts
... / ...
CommitLineData
1import { NgModule } from '@angular/core'
2import { RouterModule, Routes } from '@angular/router'
3
4import { MetaGuard } from '@ngx-meta/core'
5
6import { VideoAddComponent, VideoUpdateComponent } from './video-edit'
7import { VideoListComponent } from './video-list'
8import { VideosComponent } from './videos.component'
9import { VideoWatchComponent } from './video-watch'
10
11const 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/:uuid',
37 component: VideoUpdateComponent,
38 data: {
39 meta: {
40 title: 'Edit a video'
41 }
42 }
43 },
44 {
45 path: ':uuid',
46 redirectTo: 'watch/:uuid'
47 },
48 {
49 path: 'watch/:uuid',
50 component: VideoWatchComponent
51 }
52 ]
53 }
54]
55
56@NgModule({
57 imports: [ RouterModule.forChild(videosRoutes) ],
58 exports: [ RouterModule ]
59})
60export class VideosRoutingModule {}