如何在AngularJS渲染后再加载JS

http://www.itnose.net/detail/6100484.html

app.directive('repeatDone', function () {
return function (scope, element, attrs) {
var input = element.find('.calendar .calendarInput');
input.datepicker({ changeMonth: true, changeYear: true, maxDate:0});
element.find('.calendar .calendarButton').click(function () {
input.trigger("focus");
});
if (scope.$last) { // all are rendered
scope.$eval(attrs.repeatDone);
}
}
}); app.directive('onFinishRenderFilters', function ($timeout) {
return {
restrict: 'A',
link: function (scope, element, attr) {
if (scope.$last === true) {
$timeout(function () {
scope.$emit('ngRepeatFinished');
});
}
}
};
});
上一篇:Flutter 初始化数据完成后再加载页面


下一篇:JBOSS目录结构详细说明