// angular import { Injectable } from '@angular/core'; import { Http, Response } from '@angular/http'; // libs import 'rxjs/add/operator/map'; import 'rxjs/add/operator/catch'; import { Observable } from 'rxjs/Observable'; import { Store } from '@ngrx/store'; // app import { APIDispatcher } from '../utils/index'; @Injectable() export class MediaService extends APIDispatcher { constructor(public http: Http, public store: Store) { super(http, store); } signUrl(fileLocation: string): Observable { return this.http.get('ma_core/api/v2/mediaservice/sign_url?url=' + fileLocation) .catch(this.handleError) .map(res => (res).json()); } signForm(): Observable { return this.http.get('ma_core/api/v2/mediaservice/sign_form') .catch(this.handleError) .map(res => (res).json()); } }