I need to show real time data through angular data table 500 to 1000 datas would come in a minute, I can able to bind data but data table isn't working and I am getting data from the web socket. any help ?
HTML:
<div class="tab_container">
<table datatable class="row-border hover" id="detailedreportproduct">
<thead>
<tr>
<th>ID</th>
<th>First name</th>
<th>Last name</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let item of binddatatable">
<td>{{binddatatable.id}}</td>
<td>{{binddatatable.fname}}</td>
<td>{{binddatatable.lname}}</td>
</tr>
</tbody>
</table>
</div>
TS:
let ws = new WebSocket('ws://192.168.1.254:7851');
ws.onopen= () =>{
console.log("wsconnected");
ws.send(JSON.stringify({"MsgID":"ReqData"}));
}
ws.onmessage =(e) =>{
let Table = $('#detailedreportproduct').DataTable();
this.dataObj = JSON.parse(e.data)
this.binddatatable = dataObj;
}