well understood. How can we capture status?. Since success is executed for
all 200 series. I have to output response if it is 200-OK. Otherwise need
to capture actual error. The below code worked fine with $http.
BookingService.get({id : bookingId}, function success(response) {
alert("comes success" + response.status); // NULL . I want to check if
it is 200 ; can then assign response to booking.
$scope.showerror = false;
$scope.showresult = true;
$scope.booking = response;
} , function error(data, status, response, header){
alert("comes error" + status); // returns object. I need status code
$scope.showerror = true;
$scope.showresult = false;
$scope.status = data; //
* No Booking detail returned. Server responded with status code of
{"data":"<H1>SRVE0255E: A WebGroup/Virtual Host to handle
/RETSample1ProviderWeb/rest/booking/ADV-123 has not been
defined.</H1><BR><H3>SRVE0255E: A WebGroup/Virtual Host to handle
localhost:12000 has not been defined.</H3><BR><I>IBM WebSphere Application
Server</I>","status":404,"config":{"transformRequest":[null],"transformResponse":[null],"method":"GET","url":"http://localhost:12000/RETSample1ProviderWeb/rest/booking/ADV-123","headers":{"Accept":"application/json,
text/plain, */*"}}}*
});
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.