0

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>

And this is my directive :

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

  }
}

});

Thanks in advance.

Daniel Flores
  • 770
  • 3
  • 12
  • 31
  • http://stackoverflow.com/questions/14376879/error-10-digest-iterations-reached-aborting-with-dynamic-sortby-predicate?rq=1 The response is interesting – Utopik Jun 16 '13 at 08:36

1 Answers1

1

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>

I had same issue here.

Community
  • 1
  • 1
Ivan Chernykh
  • 41,617
  • 13
  • 134
  • 146