1 import { Injectable } from '@angular/core'
2 import { ActivatedRouteSnapshot, Resolve } from '@angular/router'
3 import { VideoService } from './video.service'
6 export class VideoResolver implements Resolve<any> {
8 private videoService: VideoService
12 resolve (route: ActivatedRouteSnapshot) {
13 const videoId: string = route.params['videoId']
15 return this.videoService.getVideo({ videoId })