How can I get last 5 records from database?
logs.component.html
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>Date</th>
<th>Logging in is completed?</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let log of logs">
<td>{{log.date}}</td>
<td>{{log.isCompleted}}</td>
</tr>
</tbody>
</table>
With above code I get all records. I would like to do something similar to:
for (int i=logs.length(); i>logs.length()-5; i--)