AngularJS-translation icon indicating copy to clipboard operation
AngularJS-translation copied to clipboard

HowTo - Call a function when ng-repeat has finished?

Open aztack opened this issue 12 years ago • 0 comments

Call a function when ng-repeat has finished

var module = angular.module('testApp', [])
    .directive('onFinishRender', function ($timeout) {
    return {
        restrict: 'A',
        link: function (scope, element, attr) {
            if (scope.$last === true) {
                $timeout(function () {
                    //do something with the element
                });
            }
        }
    }
});
<ul>
  <li ng-repeat="item in list" on-finish-render>{{item.name}}</li>
</ul>

aztack avatar May 14 '13 07:05 aztack