3
I’m making a requisition JSONP
for a webservice. But sometimes the request takes too long. As I am showing the user a loading status, I would like to abort the request if it is more than 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
})
See, man, let me ask you something slightly out of context: you’re wearing styleguide?
– Sorack
Vixe, what is it?
– Wallace Maxters
It’s a good practice manual for programming in Angular. I wanted to have discovered this when I started learning: https://github.com/johnpapa/angular-styleguide/blob/master/a1/README.md
– Sorack