I got a perfectly working service
this.getcustomers= function() {
var deferred = $q.defer();
$http({
method: 'GET',
url: 'api/customers'
}).then(function success(data) {
deferred.resolve(data.data);
}, function error(error) {
deferred.reject(error);
});
return deferred.promise;
};
How do i add a timeout
to the above. I tried samples from stackoverflow but nothing is working
I need the request to keep trying for 5000 ms and show an error when that time passes.
Adding timeout : timeout|promise
does not work with me.
Any ideas?