I need to access the variable vm.lat outside the POST below. What could I do to achieve?
var lat
var lng
$http.post(url)
.then(function(resp) {
vm.enderecoFull = resp.data
vm.geometry = vm.enderecoFull[0].geometry
vm.location = vm.geometry.location
lat = vm.location.lat
lng = vm.location.lng
}, function (error) {
console.log("Erro")
})
console.log("lat: ", lat)