Dears,
I would like to refresh the orders where its content is coming from REST API. How new orders will be updated without page refresh, in case new orders coming from the REST API? Is there any code sample?
<table id="orders" cellspacing="0" cellpadding="0">
<thead>
<tr>
<th><span>Time</span></th>
<th><span>Total</span></th>
<th><span>Type</span></th>
</tr>
</thead>
<tbody>
{{#each orders}}
<tr>
<td>{{time}}</td>
<td>{{total}}</td>
<td>{{type}}</td>
</tr>
{{/each}}
</tbody>
</table>
.js
I will update this code to fetch REST API.
Template.body.helpers({
orders: [
{ time: “1428244334180”,id: 1000, total: 10, type: “Delivery”, status: 1, sla: 45 },
{ time: “1428244347017”,id: 1001, total: 15, type: “Collection”, status: 2, sla: 30 }
],
Thx