on-ng-repeat-done 指令不起作用(页面不刷新)。但是当我刷新页面时它工作正常。我有以下示例,我们正在使用指令。
<div>
<div>
<ul>
<li ng-repeat="item in items | limitTo: 20 track by $index" on-ng-
repeat-done="enableItem()" tabindex="0">
</li>
</ul>
</div>
</div>
指令代码:
module.directive('onNgRepeatDone', function () {
return {
restrict: 'A',
link: function (scope, element, attrs) {
if (scope.$last) {
setTimeout(function(){
scope.$eval(attrs.onNgRepeatDone);
},0);
}
}
}
});