Hello guys I really need help and advice on this factory and controller issue I am having.
I have a factory that gets data from the server
sp.factory('homeFeed',['$window','$http','auth',function($window,$http,auth){ var url = auth.url; var version = auth.version; var HomeFeed = {}; HomeFeed.getFeeds = function(user){ //setting variable for get request on home feed var req = { method: 'GET', url: url + version + '/Feed', headers: { 'Content-Type': 'application/json; charset=utf-8', 'Authorization': 'Bearer ' + token }, } return $http(req).success(function(res){ return res; }); }; return HomeFeed; }]);controller--
sp.controller('HomeCtrl',['$scope','homeFeed','$window',function($scope,homeFeed,$window){ //getting all the home feed data $scope.feeds = homeFeed.getFeeds(JSON.parse($window.localStorage['SP-User'])) }]);
however, after the respond from the server, my view is not updated and the $scope.feeds is not updated as well. Greatly appreciate your help