$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);
can variable myVar be share / be access outside the scope of $http? I wrote console.log(myVar) outside it returned blank?
 
    