达到10 $ digest()次迭代。中止! - 孤立的范围

时间:2013-06-16 03:26:32

标签: angularjs

我只有在{{i}}设置为小时或天属性时才会收到此错误,有人可以解释此行为。

<td cell ng-repeat="j in [0,1,2,3,4,5,6,7]" hour="i" day="j"></td>

这是我的指示:

app.directive('cell', function(){
    return {
      scope : {
        "day":"=",
        "hour":"="
      },
  controller: WeekCtrl,
  link: function(scope,elm,attrs){

    // When using isolated scope and if we want to include parent scope variables we should define the controller. (I'm ok?)
    // When outside , in the element, we define day="{{i}}" an error about $digest overflow is produced, but with day="i" nothing happens

  }
}

});

提前致谢。

1 个答案:

答案 0 :(得分:1)

这意味着您在传递数据时修改数据,此处为:j in [0,1,2,3,4,5,6,7]。尝试像

这样的东西
<td cell ng-repeat="j in myArr=[0,1,2,3,4,5,6,7]" hour="i" day="j">
   <!--  myArr[j] = {{ myArr[j] }} -->
</td>

我有同样的问题here