循环结束后调用
首先,需要添加指令
.directive('onFinishRenderFilters',function($timeout) { return { restrict: 'A',link: function(scope,element,attr) { if(scope.$last === true) { $timeout(function() { scope.$emit('ngRepeatFinished'); }); } } }; });
$scope.$on('ngRepeatFinished',function(ngRepeatFinishedEvent) { // 你的代码 ........ });