diff options
Diffstat (limited to 'client/src/app/shared/shared-main/video/video.resolver.ts')
-rw-r--r-- | client/src/app/shared/shared-main/video/video.resolver.ts | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/client/src/app/shared/shared-main/video/video.resolver.ts b/client/src/app/shared/shared-main/video/video.resolver.ts new file mode 100644 index 000000000..65b7230ce --- /dev/null +++ b/client/src/app/shared/shared-main/video/video.resolver.ts | |||
@@ -0,0 +1,17 @@ | |||
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 | } | ||