Tag: 准备就绪

当ng-repeat完成时调用一个函数

我试图实现的基本上是“在重复完成渲染”处理程序。 我能够检测到什么时候完成,但我不知道如何从中触发function。 检查小提琴: http : //jsfiddle.net/paulocoelho/BsMqq/3/ JS var module = angular.module('testApp', []) .directive('onFinishRender', function () { return { restrict: 'A', link: function (scope, element, attr) { if (scope.$last === true) { element.ready(function () { console.log("calling:"+attr.onFinishRender); // CALL TEST HERE! }); } } } }); function myC($scope) { $scope.ta = [1, 2, 3, 4, 5, 6]; […]