Ng-repeat issue: not updating when $scope is changed


#1

I currently have an issue with my code, which is supposed to work much like any “feed”.

I call a service in my controller to initially set the $scope, much like this

var transactionpromise = feedService.getnewtransactions(10);
      transactionpromise.then( function(payload){
        $scope.transactions = payload.data;

      })

This correctly sets the scope, and the first 10 feed items are displayed.

I have a simple button at the bottom of my feed that is supposed to load the next 10 items.

 $scope.loadMore = function() {
    var transactionpromise = feedService.getnewtransactions(20);
      transactionpromise.then( function(payload){
        $scope.transactions = payload.data;
    
      }) }

This updates the scope, but the the changes aren’t displayed in the view. $apply() throws an error that the $digest cycle is already occuring, but my ng-repeat (transaction in transactions) refuses to update unless I refresh or use $state.reload();


#2

Never mind I figured it out, there was a small issue in the call and my debugging consolelogs weren’t set correctly