Error! oh noes: Angularjs $digest already in progress.
Generally you shouldn’t be using apply too often in your code, it’s mainly for when your data may have changed from outside angular and you want to update the template with model data.
You can check if a $digest is already in progress by checking $scope.$$phase.
//$digest or $apply