How to handle and retry the failed request due to poor network connection in angular 4?



How to handle and retry the failed request due to poor network connection in angular 4?..

Answer / Rahul Kumar Rai

To handle failed requests due to a poor network connection in Angular 4, you can implement a retry mechanism using observables. Wrap your HTTP calls inside an Observable and use the catchError operator to create a new Observable that will be executed when an error occurs. Inside this catchError Observable, retry the request after a delay or handle the error according to your needs.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More AngularJS Interview Questions

Explain order by filter?

1 Answers  


What is eventemitter angular2?

1 Answers  


What is lazy loading and why is it used for angular?

1 Answers  


What is directive in angularjs?

1 Answers  


What is an impure pipe?

1 Answers  


How would you control size of an element on resize of the window in a component?

1 Answers  


What do you mean by module?

1 Answers  


What is registering callbacks in angularjs?

1 Answers  


What is a module and what does it contain?

1 Answers  


What is typings in angular 2?

1 Answers  


What is $location in angularjs?

1 Answers  


What is isolated scope in angularjs?

1 Answers  


Categories