Is there a way to store data to a variable?
I tried:
$scope.another =
        function(){
            var new_data;
            userService.getInfo().success(function(data){
               new_data = data;
            });
            return new_data;
        };
var data = $scope.another();
but it returns 'undefined' in the console log. Thank you
EDIT
I now get an empty array for new_data .
var new_data = [];
$scope.another = 
                function(callback){
                    userService.getInfo().success(function(data){
                        paymentService.getCashierParams({ "cardNumber": data.cardNumber}).success(function(data){
                            gameService.getAllgames({ "PID":data.GetCashierParameters.PID, "limit": 6, "skinID": 1}).success(function(data) {
                                callback(data.data.GetFlashGamesResult.Data.FlashGame);
                            });
                        });
                    });
                };
          $scope.another(function(result){
                    new_data = result;
                });
                console.log(new_data);
 
     
    