只有当我在小时或天属性中设置了 {{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
}
}
});
提前致谢。