Upon receiving and storing data, I am looking to execute a function but the code I currently have is not producing the desired result.
Could someone provide some insight into what I might be doing incorrectly?
Here's my current code snippet:
$http({
method: 'GET',
url: 'JsonLocation'
}).then(
function successCallback(response) {
// this callback will be called asynchronously
// when the response is available.
self.responseData = response.data;
},
function errorCallback(response) {
// called asynchronously if an error occurs
// or server returns response with an error status.
console.log(response);
}
).then(
function completeCallback() {
// called when the http request is finished.
restyleData();
}
);
Although triggering the restyleData()
function manually via developer options works after the page has loaded and everything is set up, I'd prefer to automate this process after all resources are loaded.