-1

Angular's view model is not getting updated when the same is updated from controller, I have tried $scope.$apply() with the help of $scope.$watch of function but AngularJS throws an error as $digest already in progress.

Kindly explain me if any one know the solution

Seb D.
  • 5,046
  • 1
  • 28
  • 36
  • 1
    [Detailed explanation here](http://stackoverflow.com/questions/12729122/angularjs-prevent-error-digest-already-in-progress-when-calling-scope-apply) on digest cycle. – ODelibalta Jul 21 '16 at 13:34
  • Can u post the code, change to scope vars in controllers will definitely re-render dom – Shintu Joseph Jul 21 '16 at 13:35

1 Answers1

0

check if $diget is in progress by the following code , to prevent that error:

if(!$scope.$$phase) {
  // $apply or $digest
}
henrybbosa
  • 1,139
  • 13
  • 28