Angular Service
this.sendCommand = function (someData) {
URL = myURL;
return $http({
method: 'POST',
url: URL,
data: someData
}).then(function (response) {
return response.data;
}).catch(function (error) {
console.log(error)
});
};
Use Case: User can send multiple commands by clicking on a button. For example, request 2 should not return response until request 1 response is fulfilled. How do I make synchronous call using above snippet, so that even if user clicks on a button multiple times, the request being sent will be served in queue ?