Angularjs issue in relacing Ajax request with promises in service
问题 For my Angularjs application in services I have used Ajax call to get the data and is as follows : var originalRequest = $.ajax({ async : false, url : "/dash/dashboard2ajax.do", type : "POST", data : { action : 'getNetSpendOverTime', customerId : selectedAccTd, carriersId : selectedCarriers, fromDate : formattedFromDate, toDate : formattedToDate }, dataType : "json", success : function(originalRequest) { var res = originalRequest; data = res.ResultSet.Response; } }); Then I just return (data)