I have this code in an angular service:
factory.getList = function(){
$http.get('/getClasses')
.success(function (response) {
console.log(response);
return(response);
})
.error(function() {
console.log('error in getList');
});
};
When I run this I can see the response in the console, but in a controller I have:
$scope.classesList = Svc.getList();
and this classesList is always undefined. Why?