.directive('onFinishRender',['$timeout', '$parse', function ($timeout, $parse) {
return {
restrict: 'A',
link: function (scope, element, attrs) {
if (scope.$last === true) {
$timeout(function () {
scope.$emit('ngRepeatFinished'); //事件通知
var fun = scope.$eval(attrs.onFinishRender);
if(fun && typeof(fun)=='function'){
fun(); //回调函数
}
});
}
}
}
}])
return {
restrict: 'A',
link: function (scope, element, attrs) {
if (scope.$last === true) {
$timeout(function () {
scope.$emit('ngRepeatFinished'); //事件通知
var fun = scope.$eval(attrs.onFinishRender);
if(fun && typeof(fun)=='function'){
fun(); //回调函数
}
});
}
}
}
}])