I'm trying to connect my AngularJS App to a Sharepoint 2010 List.
I've tried this and this tutorial but neither work for me. Those 2 tutorials are using SharePoint 2013.
Well the first question is: "Does SharePoint 2010 have a RestAPI for me to connect with?" - If SP 2010 has this feature, why can't I connect with the list?
My list is called "Steckbrief_Data" and the code I'm trying to run is:
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope, $http) {
$http(
{
method: "GET",
url: GetSiteUrl() + "_api/web/lists/getByTitle('Steckbrief_Data')/items"
headers: {"Accept": "application/json;odata=verbose" }
}).success(function (data, status, headers, config) {
alert("success");
$scope.Employees = data.d.results;
}).error(function (data, status, headers, config) {
alert("error");
});
});
function GetSiteUrl() {
var urlParts = document.location.href.split("/");
return urlParts[0] + "//" + urlParts[2] + "/" + urlParts[3] + "/" + urlParts[4];
}
So could you tell me what is going wrong here?
Thanks and greetings, Michael