I'm trying to retrieve venues list using angularjs. Using console.log(data), I can see the the angularJS successully calling the foursquare api.
But how do I parse through each id element in the data. For example, I want to get venue name, venue contact and other details, how can I use this in ng-repeat tag.
var results = this;
$http.get("https://api.foursquare.com/v2/venues/search?client_id=CLIENT_ID&client_secret=SECRET_KEY&v=20130815&ll=17.416471,78.438247&query=coffee")
.success(function(data){
results = data;
console.log(results);
})
Check this link for sample json data: https://developer.foursquare.com/docs/explore.html#req=venues/trending%3Fll%3D40.7,-74
Thanks in advance!
var url = https://api.foursquare.com/v2/venues/search?client_id=CLIENT_ID&client_secret=SECRET_KEY&v=20130815&ll=17.416471,78.438247&query=coffee?callback=JSON_CALLBACK;
$http.jsonp(url)
.success(function(data){
console.log(data.found);
});
since you are making request to another domain, have to use JSONP. and append callback at the end of your url.
It works!!