Angular: Solving "$digest already in progress" error

TL;DR You shouldn't call $scope.$apply() or $scope.$digest() inside a function that can be invoked by Angular – e.g. in an ngClick.

The linked Stackoverflow answer has a quick overview of techniques to apply changes to a scope. It also explains what might be wrong when you're getting the error $digest already in progress and gives some information that every Angular developer should know.

Dominik Schöler About 9 years ago