我有一个大型数据集,显示在表格中!该表有1000行60列。其中24列是d3 graph.i我使用无限滚动它在滚动到底部附加30行。动态指令编译并返回html。由于重dom(svg元素),表变慢。我如何加快速度!
<table cellpadding="0" cellspacing="0" id="row-2-td-2-table">
<tr ng-repeat="item in dataset" data-code="{{item.code}}" ng-class="{'firstTr' : $index == 0}" emit-when="{event: 'allRendered', condition: $last}">
<td ng-repeat="key in orderedkeys" >
<div dynamic="Val_Helper(key,item[key])" class=" {{key}} tablechild"></div>
</td>
</tr>
</table>
js function :(由于双向绑定而被多次触发)
$scope.Val_Helper = function(key,value)
{
if(key=="firstkey")
return generategraph1(value);
if(key=="secondkey")
return generategraph2(value);
.
.
.
if(key=="sixteenthdkey")
.... return generate16graph(value);
return value;
}