How to use data ?
Closed this issue · 4 comments
Hi,
I can recover all data in my city, thanks to your plugin !
But when I have them in my client side (With angular), I can't use them ...
Have you an idea for me ? A point of start ?
Thank you ...
Sorry, but I don't really understand what you mean. If you can query the data successfully, then you should be able to use it via a Angular service or direct http call. It's not a "problem" of this project though.
Concretely, I try to use them with ng-repeat like this :
HTML :
<p ng-repeat="event in eventfb track by $index">{{event.id}}</p>
JS :
$scope.getFBevent = function() {
$http.get("http://localhost:9311/getEvent", { params:{
lat: $scope.latpos,
lng: $scope.lngpos
}
}).success(function(response) {
console.log("Success" + response)
$scope.eventfb = response;
}).error(function(response) {
console.log("ERROR" + response);
});
}
I have successfully recover the long array (like in documentation) in my console log, but in view nothing happen ... I'm sure I've made a mistake, but since yesterday I search (and struggling) to find the solution with my friend, Google.
If you can tell me how can I display the array information in my view, you are my savior !
Thank you !
Sorry, I can't really help you with that.
That's cool, I found solution. :)
But now, I have this error :
"message":"Please specify the lat and lng parameters!","code":1
My server.js :
var lat = req.body.lat;
var lng = req.body.lng;
var accessToken = myaccesstoken;
var es = new EventSearch({
"lat": lat,
"lng": lng,
"accessToken": accessToken
});
And my JS :
$scope.latpos = "43.5847713";
$scope.lngpos = "2.2472819";
// GET FACEBOOK EVENT
$scope.getFBevent = function() {
$http.get("http://localhost:9311/getEvent", { params:{
lat: $scope.latpos,
lng: $scope.lngpos
}
}).success(function(response) {
console.log("Success" + response)
$scope.eventfb = response;
}).error(function(response) {
console.log("ERROR" + response);
});
}
Have I miss something ?
Thank you for support.