You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
In Firefox 45.0.1 on Linux I encounter the following issue when loading a page with a number of disabled md-button elements, each with its own md-tooltip.
Error: [$rootScope:inprog] $digest already in progress
http://errors.angularjs.org/1.5.3/$rootScope/inprog?p0=%24digest
// add an mutationObserver when there is support for it// and the need for it in the form of viable host(parent[0])if(parent[0]&&'MutationObserver'in$window){// use an mutationObserver to tackle #2602varattributeObserver=newMutationObserver(function(mutations){mutations.forEach(function(mutation){if(mutation.attributeName==='disabled'&&parent[0].disabled){setVisible(false);scope.$digest();// make sure the elements gets updated}});});attributeObserver.observe(parent[0],{attributes: true});}
When there are mutations for multiple elements (I enable most elements on a certain loaded event), a number of digest are executed if I read the code correctly. This is what (I think) triggers the error.
I'm no expert in $digest(), so I do not know what the best solution is. My first approach was to move the scope.$digest() outside the forEach but that did not fix the issue. Note that commenting the line altogether does remove the error, so I'm quite sure this is the offending call.