The $http
has two examples. I would like to help me because I do not know which is the most useful
There is the:
var chamada = function () {
return $http.get('https:url/exemplo.json')
.then(function (response) {
return response.data;
});
}
and o:
var outraChamada = function () {
return $http.get('https:url/outroExemplo.json')
.success(function (data) {
return data;
}).error(function (status) {
return status;
})
}
Which one should I choose? Is there a way to return the date if it is changed in the Web Service (without having to call the function)?