export function promiseResult(observable: Observable<any>, self: Object): Promise<any> { return observable.toPromise() .then(response => { if (!response._body) return null; return response.json(); }) .then(result => { handleResponse(result); return result; }) .catch(handleError.bind(self)); }
sendResponse() : Return { return { $promise: this._request.toPromise().catch((e:any)=>console.error(e)), $observables: this._request } }