我有两个数组,一个用于数据' data_list'第二个是从第一个检索数据的密钥,我的问题是data_list包含每行1900行和20个字段,性能太慢,页面加载大约20秒。
如何改善此表的性能?
<tbody>
<tr *ngFor="let data of data_list;let last = last;let i = index;" #FireJQuery>
<td class="width-percent-1 sorting_1" tabindex="0"></td>
<td *ngFor="let col of Descriptive_FieldsMap;let i = index;">
<div >
{{data[col.DBName] || 'N/A'}}
</div>
</td>
</tr>
</tbody>
ts代码
this._bondServices.getBonds(this._localStorageService.get('userID').toString(), this.rulebookID, this._localStorageService.get('Project').toString())
.subscribe(
data_list =>
{
this.data_list = data_list;
}, //Bind to view
err => {
// Log errors if any
console.log(err);
},
() => {if(this.data_list) window.dispatchEvent(new CustomEvent('bonds-ready'));});
}
Services.ts代码
return this._http.get(link)
.map((res:Response) => res.json()) // ...and calling .json() on the response to return data
.catch((error:any) => Observable.throw(error.json().error || 'Server error'));