all you need to do is make a service that gets and set the user data and the data is kept inside the service. Then you make a method that returns that data and you can inject it into any controller in your app.
app.service('userData',function(){
var data;
this.get = function() {
// do your ajax call to get your user data and in the response data = response;
}
this.data = function() {
return data;
}
});
then in any controller:
function myCtrl($scope,userData) {
// you can access it with this userData.data();
// or set it to a $scope var
$scope.userData = userData.data();
}
Making a global variable isn't how you use Angular you can create a service that you then inject into your controllers so multiple places can talk to that data or you can set it to a $rootScope var and then reference it in any controller. NEVER create a global variable and reference it in your controller though. This is how you end up with memory leaks in Angular.