There seems to be an issue with updating a variable within the callback function of a promise, as shown in the code snippet below:
$scope.showSelected= function (node){
var promise = $http.get("http://127.0.0.1:5000/getResource?ldpr="+node.iri);
promise.then(function(result){
node = result.data;
});
};
The $scope.showSelected
function is a callback utilized by a widget. It takes a parameter node
which needs to be updated within the promise's callback. How can I properly update this variable within the promise's callback function?