Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Add timeout on $resource #2190

Closed
berttheuwissen opened this issue Mar 20, 2013 · 4 comments
Closed

Add timeout on $resource #2190

berttheuwissen opened this issue Mar 20, 2013 · 4 comments

Comments

@berttheuwissen
Copy link

Add the possibility to specify a timeout on a $resource.

@pkozlowski-opensource
Copy link
Member

Sorry, it isn't clear what you are asking for here. Closing for now, please reopen with a clear description if needed.

@tomdw
Copy link

tomdw commented Jul 20, 2013

It should be possible to let any rest call through the resource service of angular timeout after some time. The current implementation does not have a timeout and thus keeps waiting endlessly. This makes it impossible to detect if servers are down or not.

@pkozlowski-opensource
Copy link
Member

In 1.1.x AngularJS supports configuration options like $http and the timeout property is one of the supported options: http://code.angularjs.org/1.1.5/docs/api/ngResource.$resource

@paulistoan
Copy link

I understand how that makes sense for millisecond timeouts, however how would you be able to stop the get call below using a promise?

var User = $resource('/user/:userId', {userId:'@id'});
var user = User.get({userId:123}, function() {
  user.abc = true;
  user.$save();
});

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants