$http({
url: "php/InsertTab.php",
method: "POST",
data: {
'userId': userId,
},
headers: {'Content-Type': 'application/x-www-form-urlencoded'}
}).success(function(data, status, headers, config) {
myVar = data;
}).error(function(data, status, headers, config) {
});
console.log(myVar);
Is it possible for the variable myVar to be shared or accessed outside of the $http scope? I attempted to write console.log(myVar) outside of it but received a blank result?