Hello guys,
I’m trying to do this a few hours and not succeeding.
I have a promise of $cordovaGeolocation returning latitude and longitude very basic equal to the ngCordova documentation.
I want to know how do I return the latitude and longitude in an array I have outside the function.
How can I do this???
Following the code structure.
$cordovaGeolocation.getCurrentPosition().then(function(position) {
var lat = position.coords.latitude;
var long = position.coords.longitude;
alert(lat + " | " + long);
}, function (err) {
console.log("fail");
});
var deviceInfo = {
uuid: uuid,
dataDevice: [
{
model: model
}
]
};
Thank you