import { Injectable } from '@angular/core'; import { HttpClient } from '@angular/common/http'; import { Observable } from 'rxjs/Observable'; @Injectable() export class BrandingService { constructor(public http: HttpClient) { } public getBranding = (environment: any) => { return this.http.get(`${environment.BRANDING_API}?environment=${environment.ENV}`) .catch(this.handleError); } private handleError = (error: any) => { return Observable.throw(error || '* An error has occured'); } }