10
So far I’ve been using the success
to the Http Promises
.
Ex:
$http.get(/url).success(function(data){
console.log("Sucesso");
})
.error(function(response, status) {
console.log("erro " + status);
});
}
But today I found an example where the success
may be replaced by then
:
$http.get(/url).then(function successCallback(response) {
console.log("Sucesso");
}, function errorCallback(response) {
console.log("Erro: "+response);
});
I would like to know the differences between these two promisses
and what are the advantages of using them.
http://stackoverflow.com/questions/16385278/angular-httppromise-difference-between-success-error-methods-and-thens-a
– PauloHDSousa
You don’t really know the intent of the
stackoverflow
@Paulohdsousa?– DiegoAugusto
FOR ME is to help others solve programming problems
– PauloHDSousa
Always wondered that too @Techies
– Jéf Bueno