I'm working on converting a jquery ajax call to an angular $http call, but for some reason am returning a 404 status. Here is the original jquery call.
function getStaffInfo(){
$.ajax({
url: 'https://my.website.com/j/wkr/stafflist.php',
data: {f: 'staff'},
dataType: 'jsonp',
jsonp: 'callback',
jsonpCallback: 'vcLoadStaff',
success: function(){
//alert("success");
}
});
}
Here is the angular $http call:
app.service('staffList', function($http){
var staffList = {};
$http.jsonp('https://my.website.com/j/wkr/stafflist.php', {"f":"staff"})
.success(function(data, status, headers, config) {
console.log(data);
staffList = data;
}).error(function(data, status, headers, config) {
console.log(status);
});
return staffList;
});
Am I missing something in my angular code?