I've a datatable which is taking lot of time to show the data
I called the script like this in the component:
ngAfterViewInit() {
$.getScript('./assets/js/datatables/datatable-basic.js');
}
And rendering data in html like this
<table class="table zero-configuration">
<thead>
<tr>
<th>Name</th>
<th>ID</th>
<th></th>
</tr>
</thead>
<tbody>
<tr *ngFor="let companyData of company?.companies; trackBy: userThumb">
<td class="text-truncate">{{ companyData?.name }}</td>
<td class="text-truncate">{{companyData?.id}}</td>
<td class="text-truncate"></td>
</tr>
</tbody>
</table>
Here's my datatable-basic.js
setTimeout(function () {
$('.zero-configuration').DataTable({
"iDisplayLength": 50,
"paging": true
});
}, 3000);
The companies will be having nearly 5000 arrays.