10 $摘要()迭代到达。中止! - 隔离范围 [英] 10 $digest() iterations reached. Aborting! - isolated scope

查看:96
本文介绍了10 $摘要()迭代到达。中止! - 隔离范围的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到这个错误,只有当我有{{我}}在小时或天属性设置,有人可以解释这种现象,请。

I'm getting this error only when I have {{i}} set in hour or day attribute, someone could explain this behavior,please.

<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

  }
}

});

先谢谢了。

推荐答案

这意味着你修改你的数据,同时传递它,在这里:法官在[0,1,2,3,4,5 ,6,7] 。尝试类似

It means you modifying your data while passing on it , here : j in [0,1,2,3,4,5,6,7]. Try something like

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

我有同样的问题,<一个href=\"http://stackoverflow.com/questions/16708053/angularjs-json-data-from-view-to-controller\">here.

这篇关于10 $摘要()迭代到达。中止! - 隔离范围的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆