Debugging $rootScope:infdig

后端 未结 4 1199
既然无缘
既然无缘 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:34

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

      self.setURL = function(item) {
        var mainUrl = window.location.origin + '#/' + self.baseUrl;
        if (item) {
          mainUrl += item.testId;
        }
        $location.$$absUrl = mainUrl;
      };
    

    this was causing the $rootScope:infdig error

    So when debugging this check whatever is changing your ur, location, hrefs in your current controller/directive

提交回复
热议问题