Here is the working code:
var app = angular.module('plunker', []);
app.controller('MainCtrl', function($scope, $http) {
$scope.name = 'World';
$http({
url: 'http://landregistry.data.gov.uk/landregistry/query',
headers: { 'Content-type' : 'application/x-www-form-urlencoded',
'Accept' : 'application/sparql-results+json' },
method: "GET",
params: {
query : "select * where {?s a ?o} limit 10",
format: "json"
}
})
.success(function(data, status, headers, config) {
$scope.results = data.results.bindings;
// this callback will be called asynchronously when the response is available
})
.error(function(data, status, headers, config) {
// called asynchronously if an error occurs or server returns response with an error status.
});
});
http://plnkr.co/edit/LfkIPZRsZ4QHTfq2A2vc?p=preview
My doubt is how to store for instance, all s.values in an array such that the array can be further used to populate a drop down menu without having to save the JSON output to an external file.
Thanks.