import { Injectable } from '@angular/core' ; import { ApiCallService , ApiService } from '../services/api-call.service' ; import { Observable } from 'rxjs' ; import { map } from 'rxjs/operators' ; @ Injectable ( { providedIn : 'root' } ) export class DebugService < T = any > implements ApiService { public servicePrefix : string = 'debug' ; public constructor ( private api ) { } public getResponse ( statusCode ) { return this . api . callGet < T > ( `${ this . servicePrefix }/error/${ statusCode }` ) . pipe ( map ( ( apiResponse ) => { return apiResponse . body ; } ) ) ; } public getResponseWithMessage ( statusCode , customMessage ) { return this . api . callGet < T > ( `${ this . servicePrefix }/error/${ statusCode }/${ customMessage }` ) . pipe ( map ( ( apiResponse ) => { return apiResponse . body ; } ) ) ; } }