How to call function from controller to service in angular JS : Here is the code..
service

    self.getNewCourses = function() {
                return "temp variable";
            }

controller

$mmCourses.getNewCourses().then(function(data) {
    $scope.names = data;
    
    alert($scope.names);
});
