I'm trying to understand the differences between JQuery GET
method and Angular JS $http GET
method. I'm not sure whether these two methods can be differentiated as per Synchronous and Asynchronous terms. Can anyone explain taking these below scenarios.
Angular JS Code:
// Simple GET request example:
$http({
method: 'GET',
url: '/someUrl'
}).then(function successCallback(response) {
// this callback will be called asynchronously
// when the response is available
}, function errorCallback(response) {
// called asynchronously if an error occurs
// or server returns response with an error status.
});
JQuery Code:
$("button").click(function(){
$.get("demo_test.asp", function(data, status){
alert("Data: " + data + "\nStatus: " + status);
});
});
My question is - which implementation is more reliable and easy to use? Which one do you suggest?