It seems you want to declare a variable in your controller so that your service can write data to that variable. You need to think about it the other way around, passing the service to your controller through dependency injection
app.controller('homeCtrl', function($scope, myServiceIsNowInjected){
})
and then calling a method on that service in the controller:
myServiceIsNowInjected.getDataFromServer('my param');
You will then encounter the problem that getting data from a server is asynchronous, so you need use angular promises so that you can assign the result to a variable on your scope when the data is received. The above, still in your controller will become:
myServiceIsNowInjected.getDataFromServer('my param').then(function(data){
$scope.viewvar = data;
}, function(err){ console.log(err) });
In this way, rather than passing a global variable to the service for the service to write the data to that variable, instead you ask the service to perform some task, and have the controller write the result of that task to the $scope, making it available to the view.
A full solution example of exactly this is available as mentioned here.
$rootScope should not be used for this kind of thing - it will cause you problems as your application grows, whereas using modular controllers which pull information from services will not.