$scope not updating view with infinite-scroll


#1

I’ve been having a problem with my code which is trying to update a “feed”. The data is fetched from a service and I can see the $scope updating when it does so, but my view isn’t updating. Here’s what it looks like.

//in my controller, this initializes the feed

var feedpromise = feedService.getfeed(position,range);
feedpromise.then(function(payload) {
  $scope.feed = payload.data;

})
 

//then in my loadMore function, this extends the feed for the infinite scroll

$scope.loadMore = function() {

var feedpromise = feedService.getfeed(position,extendedRange);
feedpromise.then(function(payload) {
  $scope.feed = payload.data;
  console.log($scope.feed); //shows the longer, updated feed
})

};

I can see the scope updating upon the promise returning. $apply doesn’t work, which makes sense because the scope update is happening in the controller. Though I am pretty new to angular nothing stands out to me and after many hours of searching I’m still clueless. The load more function is being fired by the infinite scroll directive just fine as well.

The html is pretty simple

//html
<ion-list ng-repeat="item in feed">
    {{item.info}} //item etc, displays fine
</ion-list>

     <ion-infinite-scroll  
    icon="ion-loading-c"
   on-infinite="loadMore()" >
     </ion-infinite-scroll>