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

22 lines
636 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');
2015-07-28 22:29:07 +00:00
});
2015-07-06 04:29:05 +00:00
}
if (scope.$last === true) {
2015-07-28 22:29:07 +00:00
console.log(element);
2015-07-06 04:29:05 +00:00
$timeout(function () {
2015-07-28 22:29:07 +00:00
console.log('ngRepeatFinished')
2015-07-06 04:29:05 +00:00
$rootScope.$broadcast('ngRepeatFinished');
2015-07-28 22:29:07 +00:00
});
2015-07-06 04:29:05 +00:00
}
}
};
2015-07-06 04:29:05 +00:00
});