Getting data from JSON url using angularJS Getting data from JSON url using angularJS json json

Getting data from JSON url using angularJS


You can use $http service: Documentation

So you can:

$scope.add = function(){  $http.get($scope.url).then(function(response) {            $scope.newMessage = response.data.queries.request.totalResults;            $scope.messages.push($scope.newMessage);  });};


Read a little in $http service provided by AngularJS

here is the hint to the code that you would use

$scope.add = function(){    $http.get(url).then(function(response){        queries = response.queries;        $scope.newMessage = queries.request.totalResults;    })}


See http://plnkr.co/edit/nZkYsxLHLvf3SZNiJKic?p=info

Following your link, I just found one error:

var x = searchResults.split('.');

don't have function split() if i replace: x = "abc"

the result : Steve Jobs - 515,000,000 results - a.b resultsdsgdfg - a.b results