Hi angular team,
First of all, thanks for all the great work you guys are doing.
I am facing this issue ( error in subject above ) when moved from v 1.0.7 to 1.2.11
Tried most of things available from various channels and suggestions after googling.
But not able to understand the root cause.
Could you please give some insight.
Thanks,
Kanwaljeet
[ Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting!
Watchers fired in the last 5 iterations: [] http://errors.angularjs.org/1.2.11/$rootScope/infdig?p0=10&p1=%5B%5D ]
Hi, @KKS1.
So, the issue tracker is really not the place for getting support with the framework, and you're even less likely to get help when you don't give an example of what you're trying to do which results in the infdig error.
However, infdig errors are typically related to model instability. A watcher will keep triggering the watch functions again until the model stabilizes, or until TTL is reached, whichever comes first.
Another situation which can cause this is using functions which always return a new object, even when the data is the same.
Anyways, I'm going to close this as this is not really a bug report at this time, but if you need more help with this, check out #angularjs, stackoverflow or the mailing list
This is happening to me too.
@blipntime please refer to the above comment --- if this is not happening due to model instability, then it may be a bigger problem which need be addressed (if it is, it is most likely a duplicate of other issues surrounding $location). Without more details it's really hard to say.
@caitp My setup is this:
<script type="text/ng-template" id="/checkboxes.html">
<div ng-controller="CheckboxesController">
<label ng-repeat="checkbox in r.values" >
<input type="checkbox" value="{{checkbox.value}}"
ng-click="checkbox.changed()" >
<span>{{checkbox.display_name}}</span>
</label>
</div>
</script>
<div ng-controller="SearchController">
<div ng-cloak ng-repeat="r in refinements" ng-include src="template(r)"></div>
</div>
The inner controller CheckboxesController tells SearchController to make an Ajax call. When the call returns SearchController updates its $scope.refinements. refinements is an array in which each element has one array:
[{"display_name":"Age Range","values":[{"display_name":"20s","status":1,"value":100133},{"display_name":"30s","status":1,"value":100134},{"display_name":"40s","status":1,"value":100135},{"display_name":"50s +","status":1,"value":100136}],"type":"checkboxes"}
Then I get the error. The problem does not show when I make a "pet" project. It only shows when the response is large and there are many dozens of refinements. I already commented out all other code and have no idea where I change the values to confuse Angular, if that's the case.
What do you mean by $location and model instability? Any examples? I am not using $location right now. Even though there is an error, everything works.
I'm pretty sure your issue is model instability in r.values
due to it being modified by lots of different $http requests in a single $digest, though it's hard to say without seeing the controller itself. I believe there is an issue open about this, and @petebacondarwin's debounce service could potentially lend itself to mitigating this problem.
@caitp Thanks for trying to help. I even tested what happens when I do $scope.refinements = angular.copy(refs);
Same error. Status could change when the user clicks a checkbox, but it does not have to (status represents 'checked' coming from our backend). We rerender the /checkboxes.html template whenever the user clicks on any checkbox in it.
I'm not positive you understood what I was saying (it's hard to explain clearly), but it's really impossible for anyone to help without more information. I suggest asking in the IRC channel or on the mailing list, people will be more than happy to help.
I get this error as a result of including jquery. When the explicit jquery import is removed the error doesn't occur.
I solved the problem that @caitp was helping me with. Modifying the model while the digest is in progress triggers a new digest. Thanks @caitp a lot !!!
I have no idea why jQuery would cause a similar problem. I know that without jQuery, Angular falls back on a basic implementation of jQuery-like functionality.
Okay, I couldn't find an exact answer, so this is what worked for me (hopefully it helps someone else).
This is occurring for me in AngularJS v1.2.22.
In IE8 / IE9 I get the $rootScope:infdig
from using window.location = 'XYZ';
to change the URL. It works fine in Chrome/FF/Safari, just not IE.
The solution for me was to simply use $location.
Ex:
_Instead of:_
window.location = '/#!/test123/';
_Use:_
$location.path('test123').replace();
Hi - I work at an edtech company called Pedago. We have a software team that is split across two regions. We also have non-software folks located in several cities from the east coast to the west coast. All of us need to work together each week. Our director of engineering who has worked on geographically split teams for the last 10 years recently wrote a post on our blog about strategies to make remote teamwork effective: http://blog.pedago.com/2014/11/20/rootscopeinfdig-10-digest-iterations-reached-aborting/
Here's an outline of the 5 points. Hope this helps!
Shared chat rooms
Shared hours
Daily video check-ins
Aggressively help others and ask for help
Follow the rules
(銉籣銉汇兙)???
Hi, I have this error when I use ng-include with Webpack and es6.
I had problem with md-data-table component. I used ng-cloak
in view for md-data-table directive and it resolved the issue.
FWIW, it is hardly possible for ng-cloak
to solve a $rootScope:infdig
error. Just saying...
This is happening to me too.
Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting!
Watchers fired in the last 5 iterations: [[{"msg":"fn: regularInterceptedExpression","newVal":2},{"msg":"fn: expressionInputWatch","newVal":true},...,,{"msg":"fn: regularInterceptedExpression","newVal":2}]]http://errors.angularjs.org/1.3.15/$rootScope/infdig?
<div style="position:relative;">
<div ui-tree drag-enabled="false">
<ul class="nav nav-treebar " ui-tree-nodes="" ng-model="treeNodes" id="tree-root">
<li data-nodrag ui-tree-node
ng-repeat="pttn in treeNodes.children"
ng-class="{true:'active'}[selectedPTTNId==pttn.id]"
ng-include="'ptms_treenode.html'"></li>
</ul>
</div>
</div>
<script type="text/ng-template" id="ptms_treenode.html">
<div ui-tree-node class="tree-node" ng-click="onTreeNodeClicked(pttn,$event);" ng-dblclick="onToggleCollapse(pttn,$event)"
ng-init="onTreeNodeInit(pttn);" onselectstart="return false;">
<span class="tree-txt" ng-bind="pttn.nodename" />
</div>
<ul class="nav nav-treebar " ui-tree-nodes="" ng-model="pttn.children" ng-class="{hidden:pttn.collapsed}">
<li data-nodrag ng-repeat="pttn in pttn.children" ui-tree-node ng-include="'ptms_treenode.html'" ng-class="{true:'active'}[selectedPTTNId==pttn.id]"></li>
</ul>
</script>
@caitp Thanks a lot.