Wywołanie funkcji po zakończeniu ng-repeat

To, co próbuję zaimplementować, to w zasadzie „obsługa ng repeat zakończeniu renderowania”. Jestem w stanie wykryć, kiedy to się skończyło, ale nie wiem, jak wywołać z niego funkcję.

Sprawdź skrzypce: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];
    function test() {
        console.log("test executed");
    }
}

HTML

<div ng-app="testApp" ng-controller="myC">
    <p ng-repeat="t in ta" on-finish-render="test()">{{t}}</p>
</div>

Odpowiedź: Pracujące skrzypce od wykończenia:http://jsfiddle.net/paulocoelho/BsMqq/4/

questionAnswers(10)

yourAnswerToTheQuestion