Created
January 14, 2018 13:18
-
-
Save brachi-wernick/83a69f55ba92b36352800ed23fdd9e2a to your computer and use it in GitHub Desktop.
send callback on http error
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public deleteItem(id: number, callback?: any): Observable<{}> { | |
//some prepartion of the http request... | |
return this.http.request(path, requestOptions) | |
.map((response: Response) => { | |
//some stuff... | |
}).catch((error: any) => { | |
error.callback=callback; | |
return Observable.throw(error); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment