$http({
url: "php/load.php",
method: "GET",
params: {'userId':userId}
}).success(function(data, status, headers, config) {
$scope.mydata = data;
mydata = data;
}).error(function(data, status, headers, config) {
});
strange, why $scope.mydata and mydata can't be access outside of $http scope? it's understandable $scope.mydata can't be access but why a global variable - mydata is too undefined?