0

I am making a single page application using angular, at times the backend services do not response or are down and browser takes very long time to timeout request.

How can I forcefully timeout an http request from frontend in lesser time, this will help me show message to user that backend is not responding.

Jyoti Puri
  • 1,326
  • 10
  • 17
  • 2
    Since you tagged your question "angularjs", maybe have a look at http://odetocode.com/blogs/scott/archive/2014/04/24/canceling-http-requests-in-angularjs.aspx. – Oskar Lindberg Oct 13 '14 at 06:31

1 Answers1

1

$http config has a timeout property that you can set when making a request with $http.

If you want to get something done at global level for all $http can look at this SO post How to set a global http timeout in AngularJs

Community
  • 1
  • 1
Chandermani
  • 42,589
  • 12
  • 85
  • 88