A problem of passing parameters in angularJS service

see a question about angularJS passing parameters on sf, link here

the code is as follows:

var app = angular.module("demo.controllers", []);
//url
app.factory("Path" , function(){
    return {
        main_request_url: "http://0.0.0.0:3001/apis/v1_1/"
    }
});

app.factory("MediaResource" , ["$http" , "Path" , function($http , Path){

    return {
        //callback 
        all_of_media: function(call_back_param){
            //
            $http({
                url: Path.main_request_url+"/media.json" , 
                method: "get", 
                headers: {
                    "Content-Type": undefined
                }
            }).then(function(data){
                //callback
                call_back_param(data);
            });
        }
    }

}]);

app.controller("MainCtrl" , function($scope , MediaResource){

    //callback
    MediaResource.all_of_media(function(params){
        //$scope 
        $scope.results = params.data;

    });

});

among them, params.data, can be done directly by call_back_param (data),. I don"t quite understand why it is possible to do so.

Feb.28,2021

call_back_param is a parameter of all_of_media . It is a function
that is called after the request and passes the requested data to this function

call_back_param(data);

and you pass, call MediaResource.all_of_media to

function(params){
        //$scope 
        $scope.results = params.data;

    }

is passed to it as a parameter, that is,

defined above
call_back_param
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3a94d-2b58a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3a94d-2b58a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?