0

In my angularjs application I have these lines of code

getGridPage('api/accounts/gettransactions') //$http call to server which sets the $scope
$scope.transactions = {}

and I'm getting $digest already in progress error. How can I avoid it?

sqlcte
  • 323
  • 2
  • 6
  • 20
  • 3
    I'm pretty sure neither of these two lines is the source of the problem. How about showing the contents of getGridPage? – noppa Apr 26 '16 at 23:31
  • While I agree with the comment above me, check out this answer: http://stackoverflow.com/questions/12729122/angularjs-prevent-error-digest-already-in-progress-when-calling-scope-apply (I don't know how to link directly to answers, sorry). Also be sure to read the comments on it. – Chris Stanley Apr 27 '16 at 00:22

1 Answers1

0

Somewhere in getGridPage() you're calling scope.$apply() or scope.$digest. Get rid of that call and the error will go away.

bcherny
  • 3,072
  • 2
  • 27
  • 35