Within my web page controller, I have implemented the following Javascript code:
$.getJSON('resources/properties/properties.json', function(data) {
$scope.properties = data;
});
$http({
method: 'GET',
url: $scope.properties.Properties.dataLocation
}).
success(function (data) {
$scope.all_types_and_configs = data;
$scope.exec = [];
}).
error(function (data) {
$scope.error = data.message;
$scope.data = '';
return;
});
});
The format of the json file being fetched is not causing any issues.
The intention is for the $.getJSON command to be executed first and then followed by the $http request. However, when I attempt to display "properties" using a console.log just below it, the output is "undefined."
Why is the sequence of execution not following the order in which it has been written?