I have a service like
app.factory(\'geolocation\', function ($rootScope, cordovaReady) {
return {
getCurrentPosition: cordovaReady(function (onSu
Correct me if I'm wrong, but the presented solution won't work completely anymore, since newer Angular versions (>1.2!?) do no longer unwrap $q promises automatically.
Thus:
$scope.city = geolocation.getCurrentCity();
will always be a promise. So you will always have to use:
geolocation.getCurrentCity().then(function(city) {
$scope.city = city;
}