angular2-rest icon indicating copy to clipboard operation
angular2-rest copied to clipboard

How to handle ajax error?

Open ibufu opened this issue 9 years ago • 2 comments

ibufu avatar Jan 18 '16 02:01 ibufu

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')
  );

Discountrobot avatar Jan 18 '16 10:01 Discountrobot

add responseInterceptor. after use like this return response.catch (()=>{});

akarabach avatar Mar 04 '17 15:03 akarabach