The purpose of controllers is binding data to your view. They should not contain any logic and merely communicate with your services.
homeModule.controller('homeCtrl',function($scope,Categories){
$scope.categories = Categories.items;
});
Add a function to your service that fetches the data and stores it on itself:
fetchAll: function(){
var defer = $q.defer();
var self = this;
$http.get(URL})
.then(function(res){
self.data = res.data;
defer.resolve();
});
return defer.promise;
},
(Note that this is just one possible way to do things. Nothing prevents you from returning the data instead of storing it on the service. Do as you need.)
If possible, you should consider fetching your data before your view gets initialized. By doing so, you can ensure that necessary data is available as soon as the user get's the page.
See $http request before AngularJS app initialises?
Further reading
https://docs.angularjs.org/guide/services (Read the complete developer guide)
http://toddmotto.com/rethinking-angular-js-controllers/
Also I recommend the official Tutorial