Last active
March 9, 2018 15:57
-
-
Save sandangel/711903cd7b9141bad545e9a8571ed6b1 to your computer and use it in GitHub Desktop.
Show toast to get user response with error message in Angular HttpClient interceptor
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
return next.handle(req).pipe(catchError((err, original) => { | |
return showToast(err.error).pipe(concatMap(toastResult => toastResult ? original : throw(err))); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment