I want to know more about $scope.apply() in real time usage. How many times can we use $scope.apply() in a controller?
For example, I have some events like ng-click() , ng-change(), ng-blur() etc. All events are in the same controller. For each and every event, should i use $scope.apply()? If yes, I am getting error :
Error: [$rootScope:inprog] [http://errors.angularjs.org/1.2.15/$rootScope/inprog?p0=%24apply][1]
at Error (native)
I have read in this forum that removing the addition $scope.apply() will resolve the issue.
angularjs $scope.$apply() gives this error: Error: [$rootScope:inprog]
I implemented the same solution of removing multiple $scope.apply() from the code. The errror is gone, but I want to know how and why?
Can anyone please explain.
Thanks in advance.