-
Notifications
You must be signed in to change notification settings - Fork 48
Description
I am currently trying to add IndexedDB support to my application as alternative to WebSQL.
During refactoring I came upon an error on some pages which appears to only happen in Firefox.
Error: [$rootScope:inprog] $digest already in progress
http://errors.angularjs.org/1.4.5/$rootScope/inprog?p0=%24digest
I've tracked down the problem to the method createDatabaseConnection where $rootScope.$apply is called.
Funny thing is that this only occurs on pages where I use ng-include with the onload attribute.
<ng-include src="'js/shared/map.html'" onload="loadMap()"></ng-include>
The onload simply calls a method in the $rootscope which does some initializing for Openlayers.
I currently don't understand why this happens or if I am doing something wrong.
One workarround I found is to delay the init method via calling setTimeout but I would be happy with something more robust and permanent.
Are the calls to $apply necessary? Or is there any way to prevent this error?
If I've got time I might try to upload an example, but I don't know if it's that easy to reproduce without the environment.