Hello, I am currently in the process of familiarizing myself with AngularJS for the second time. I have successfully created an http request without any issues. However, my question pertains to how I can retrieve the result of this request and store it in a variable?
var cust_url = "RETURN A JSON";
var FINAL_FILE = "";
$http.get(cust_url)
.then(function (response) {
$scope.details = response.data;
//--> do multiple modifications to response.data
FINAL_FILE = 'something';
});
$scope.data = {
/*USE HERE --> FINAL_FILE
// returns 'undefined' on the console if I try to access FINAL_FILE
*/
};
Apologies for my oversight, I realize this might seem like a trivial mistake. Thank you for your assistance.