]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/app/shared/shared-main/video/video.resolver.ts
Support video views/viewers stats in server
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / shared-main / video / video.resolver.ts
1 import { Injectable } from '@angular/core'
2 import { ActivatedRouteSnapshot, Resolve } from '@angular/router'
3 import { VideoService } from './video.service'
4
5 @Injectable()
6 export class VideoResolver implements Resolve<any> {
7 constructor (
8 private videoService: VideoService
9 ) {
10 }
11
12 resolve (route: ActivatedRouteSnapshot) {
13 const videoId: string = route.params['videoId']
14
15 return this.videoService.getVideo({ videoId })
16 }
17 }