Open aztack opened 11 years ago
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>
Call a function when ng-repeat has finished