I need to make a sync get rest call and i dont want to deffer it, i want to get result and act upon the value for next processing.
Based on input to a external api call i get a result and with the response i do some processing so i cant deffer the call.
I tried a call back function :
$scope.getRxHccValue = function (diagDesc) {
problemsModel.getRxHccValue(diagDesc, function () {
return problemsModel.rxHccValue;
});
}
but while fetching call deffered.promise doesnt not return value synchronously
var deffered = this.$q.defer();
this.$http.get(this.baseUrl + '/getRxHcc', { params: { diagDesc: diagDesc } })
.success(function (data) {
deffered.resolve(data);
});
return deffered.promise;