//有些方法需要在ng-repeat渲染完成后执行(没有渲染完成页面有些元素还没有,没法绑定一些事件)
app.directive('repeatFinish', function ($timeout) {
return {
link: function (scope, element, attr) {
if (scope.$last === true) {
$timeout(function () {
//合并战区列
uniteTdCells('structured');
});
}
}
}
});
//引用上面的repeatFinish
<tr ng-repeat="item in companyList" repeat-finish></tr>