I have a rest api which returns true/false, i called my rest api in postman and it works and it returns true or false. I need to call this service in angularjs, what change should i do in my angular js to make it return true/false, beacause now it returnsobjewct object.
function checkIsActive() {
return $resource('http://localhost:8080/myservice/v1/testService').query().$promise;
}
For APIs that return boolean values, use the $http service:
The $resource service returns arrays for the
.queryaction method and objects for the.getaction method.Keep in mind that the service returns a promise from which the data needs to be extracted: