Debugging $rootScope:infdig

后端 未结 4 1201
既然无缘
既然无缘 2021-02-13 17:58

This is a common problem:

5 $digest() iterations reached. Aborting!
Watchers fired in the last 5 iterations: []

The docume

4条回答
  •  天涯浪人
    2021-02-13 18:14

    For me the error was happening in a method changing the url:

    > self.setURL = function(item) {
    >    
    > 
    >//Ajax call followed by promise function
    >      servicejsfile.somefunctiom(transferObj).then(responce){
    >        
    
    > var somethingTrue=responce.featureAvailable;
    >if (somethingTrue) {
    > dothis();
    >}else
    > $window.location = newlocation;
    > };
    

    This change the last portion of URL of my application. this was causing the $rootScope:infdig error

    So when debugging this, I commented out this portion, and error was not repeated along with requirement of application also changed.

    I am not able to fix this so we requirement remains same and I can change the location.

    This issue is taking place from some a Ajax call inside a funtion of a controller, and only in IE For FF , chrome and safari it is behaving perfect as JavaScript engine is faster for these browsers.

提交回复
热议问题