tellform/public/modules/forms/directives/on-finish-render.client.directive.js

21 lines
610 B
JavaScript
Raw Normal View History

2015-07-06 04:29:05 +00:00
'use strict';
angular.module('forms').directive('onFinishRender', function ($rootScope, $timeout) {
return {
restrict: 'A',
link: function (scope, element, attr) {
if (scope.$first === true) {
$timeout(function () {
$rootScope.$broadcast('ngRepeatStarted');
}, 500);
}
if (scope.$last === true) {
$timeout(function () {
// console.log('ngRepeatFinished')
$rootScope.$broadcast('ngRepeatFinished');
}, 500);
}
}
}
});