google.maps.event.addListener(marker, 'dragend', function() {
getmydata = function() {
return $http.get("getConnectionData.php").then(function (response) {
$scope.links1 = response.data.records;
});
}
getmydata().then(function(data) {
// stuff is now in our scope, I can alert it
console.log("hiiiii" , $scope.links1);
});
});
Here I want to call this section outside of dragend function- google.maps.event.addListener(marker, 'dragend', function() {
getmydata().then(function(data) {
// stuff is now in our scope, I can alert it
console.log("hiiiii" , $scope.links1);
});
How can I do this .