From 4a6995be18b15de1834a39c8921a0e4109671bb6 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 3 Jun 2016 22:08:03 +0200 Subject: First draft to use webpack instead of systemjs --- client/src/app/videos/shared/video.service.ts | 82 +++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 client/src/app/videos/shared/video.service.ts (limited to 'client/src/app/videos/shared/video.service.ts') diff --git a/client/src/app/videos/shared/video.service.ts b/client/src/app/videos/shared/video.service.ts new file mode 100644 index 000000000..76d46cbb4 --- /dev/null +++ b/client/src/app/videos/shared/video.service.ts @@ -0,0 +1,82 @@ +import { Injectable } from '@angular/core'; +import { Http, Response, URLSearchParams } from '@angular/http'; +import { Observable } from 'rxjs/Rx'; + +import { Pagination } from './pagination.model'; +import { Search } from '../../shared'; +import { SortField } from './sort-field.type'; +import { AuthService } from '../../shared'; +import { Video } from './video.model'; + +@Injectable() +export class VideoService { + private static BASE_VIDEO_URL = '/api/v1/videos/'; + + constructor( + private authService: AuthService, + private http: Http + ) {} + + getVideo(id: string) { + return this.http.get(VideoService.BASE_VIDEO_URL + id) + .map(res =>