Add timeout on $resource
Add the possibility to specify a timeout on a $resource.
Sorry, it isn't clear what you are asking for here. Closing for now, please reopen with a clear description if needed.
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.
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
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();
});