I am trying to read a simple file from my PODController in AngularJS:
<script>
function PODController($scope, $http) {
$http.get('POD.json').success(function(data) {
$scope.results = data.results;
console.log("Here");
}).error(function(data, status, headers, config) {
console.log('error');
});
}
</script>
Just like: Filtering by multiple checkboxes in AngularJS and his example on plunk: http://plnkr.co/edit/lNJNYagMC2rszbSOF95k?p=preview
But it seems like I am getting a:
XMLHttpRequest cannot load file:///Users/simon_zhu/Desktop/initializr/POD.json. Cross origin requests are only supported for HTTP.
Both files are in the same folder and he seems to be doing it fine in his example. Is there something I missed?
localserver.