]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/app/shared/shared-main/video/video.resolver.ts
Implement two factor in client
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / shared-main / video / video.resolver.ts
CommitLineData
c729caf6
C
1import { Injectable } from '@angular/core'
2import { ActivatedRouteSnapshot, Resolve } from '@angular/router'
384ba8b7 3import { VideoService } from './video.service'
c729caf6
C
4
5@Injectable()
384ba8b7 6export class VideoResolver implements Resolve<any> {
c729caf6
C
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}