After migrating our AngularJS application from v1.2.9 to v1.6.9, whenever I click on any dropdown option, I get error in developer console stating
'Error: [$rootScope:inprog] $apply already in progress'
I have tried using $timeout solution and it solves the issue for some cases(where $apply was used). However, this specific issue occurs when I am clicking on a dropdown option. I have not called $apply anywhere in my code. I tried using the ng-options in select tag too, however the issue still occurs.
Select tag that gives issue:
<select name="task" id="task" ng-model="search.task">
<option data-ng-repeat="each in taskList" value="{{each.id}}"
ng-selected="each.id==search.task">
{{each.taskName}}
</option>
</select>
Code changes after using ng-options:
<select ng-model="search.task" ng-options="each for each in taskList">
<option value="">Task Type</option>
</select>
Please follow link for complete error stack
Error: [$rootScope:inprog] $apply already in progress http://errors.angularjs.org/1.6.9/$rootScope/inprog?p0=%24apply
How do I fix this error? Any help/pointer is much appreciated.