I have:
$scope.bounds = {}
And later in my code:
$scope.$on('leafletDirectiveMap.load', function(){
console.log('runs');
Dajaxice.async.hello($scope.populate, {
'west' : $scope.bounds.southWest.lng,
'east': $scope.bounds.northEast.lng,
'north' : $scope.bounds.northEast.lat,
'south': $scope.bounds.southWest.lat,
});
});
The borders you can see when begging are empty, but they are loaded later (a few milliseconds) using the javascript library ( angular flyer ). However, it $scope.$on(...)is executed before the boundaries are set, so it 'west' : $scope.bounds.southWest.lng,returns an error with the variable undefined.
What I want to do is to wait for the border ( southWestand northEast) to be installed, and then run Dajaxice.async.hello(...).
So I need something like "wait until the boundaries are set."
source
share