AngularJS-translation
AngularJS-translation copied to clipboard
HowTo - Call a function when ng-repeat has finished?
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>