angular2-rest
angular2-rest copied to clipboard
How to handle ajax error?
please elaborate.
Since the rest client is simply returning a RxJS observable, you should read up on how the RxJS/subscribe method works.
You simply supply another callback like so:
myMethod
.subscribe(
data => console.log(data),
err => console.log(err),
() => console.log('Completed')
);
add responseInterceptor. after use like this return response.catch (()=>{});