I am calling a restful sharepoint 2010 service via Angular JS as following but when I run the application I always get the "No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access." error. NOTE: If I try the same GET method from my local machine via Chrome POSTMAN tool the same call works. What am I doing wrong?
var myApp = angular.module('MyApp', []);
myApp.config(function($httpProvider) {
//Enable cross domain calls
$httpProvider.defaults.useXDomain = true;
delete $httpProvider.defaults.headers.common['X-Requested-With'];
});
myApp.controller('MYCtrl', function($scope, $http) {
var site = 'http://inside.company.net/it/gsst/private/_vti_bin/listdata.svc/CCPMGAST';
$http({
method: 'GET',
withCredentials: true,
url: site,
headers: { "Accept": "application/json; odata=verbose" }
}).success(function (data, status, headers, config) {
$scope.getCallJSONResult = data;
}).error(function (data, status, headers, config) {
$scope.getCallJSONResult = "Get error";
});
});