ng-repeat动态生成的DOM如何获取宽度(封装好的方法)
define(['custom/bootstrapApp'],function(app){
app.filter('getTabWidth',function(){
return function(arg,index,arr,widFn){
if(index&&arr){
if(index==(arr.length-1)){
console.log('表格宽度获取成功');
widFn&&widFn();
}
}
return arg;
}
})
})
使用方法:
<tr ng-repeat="x in data track by $index">
<td width="100"><span ng-bind="(x | getTabWidth:$index:data:getTabWidth).dataDate">日期</span></td>
</tr>
I'm clj, I have one dream.