2013-06-16 2 views
0

Я получаю эту ошибку, только если у меня есть {{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 

    } 
} 

});

Заранее спасибо.

+0

http://stackoverflow.com/questions/14376879/error-10-digest-iterations-reached-aborting-with-dynamic-sortby-predicate?rq=1 Ответный отзыв – Utopik

ответ

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.

Смежные вопросы