I am making a JSONP
request for a webservice. But sometimes the request takes too long. Since I am showing the user a load status, I would like to abort the request if it passes 10 seconds.
How do I set a timeout for a request in AngularJS?
Example:
var url = "https://exemplo.com.br/" + $scope.consulta.cep + "/json/";
$http.get(url)
.then(function (response) {
// faz o resto aqui
})