I nedd some help with geofire.
I am trying something like that:
function success(position) {
if (option === 'set_location') {
console.log(geoService);
restaurants.$child(restaurant.$id).$update({location: {lat: position.coords.latitude, lon: position.coords.longitude}}); //works till here.
var $setRestPosition = geoService.set(restaurant.$id, [position.coords.latitude,position.coords.longitude]);
$setRestPosition.then(function(){
console.log('test')
});
return $setRestPosition
}
}
I'm getting:
ncaught TypeError: Cannot read property 'Promise' of undefined
n
n.set
success
The console displays this for the geoService( when it is collapsed.):
n {set: function, get: function, remove: function, query: function}:....
I am not using the angular geofire client.
Thanks.