Hi,
I am using REST web service which is developed in Java. Below is the description how that service is implemented
1. AsynContext, with Start and Complete method
Which returns the data asynchronously. We checked in cURL and we are able to read the data as it comes.
But in when we consume that web service in AngularJS we are not able to get data. Here we used defer and promise like below
service.GetAllSensors=function(){
var deferred = $q.defer();
.success(function (data) {
alert("return success "+ deferred.resolve(data));
return deferred.resolve(data);
})
.error(function (data) {
alert("error" + data);
return {"status": false};
});
return deferred.promise;
};
//Calling method
SensorDataService.GetTest().then(function(promise) {
alert("promise result"+ promise);
});
So could anybody tell me why I am not getting the data from the service here.
Thanks,
Mahendra