Can someone give me some assistance in converting this AJAX get list items to $http? Specifically I am trying to get the different fields to $scopes. I am aware that when doing $http now you can no longer use "success" and I pass in response.data but when I use angular.forEach and console.log the variables I am not getting anything in the console. I would much prefer to learn to do this the angular way without creating a service if possible.
$(document).ready(function getListItems() {
$.ajax({
url: url + "/_api/web/lists/getByTitle('POST')/items?&$select=Post,Arena,Country,City",
type: "GET",
headers: { "Accept": "application/json;odata=verbose" },
success: function (data) {
$.each(data.d.results, function () {
var arena = this.Arena;
var post = this.Post;
var city = this.City;
var country = this.Country;
console.log(post);
console.log(arena);
console.log(country)
console.log(city)
});
},
error: function (errorMsg) {
console.log(errorMsg);
}
});
});