In my pagination component, here is my code below:
<p>Showing {{(page-1) * pageSize}} to {{ Math.min((page-1) * pageSize + pageSize,tasks.length)}} of {{tasks.length}}</p>.
But it did not works. Can anybody tell what problem it has?
In your component, you could add math = Math;, then in your html, change it to
<p>Showing {{(page-1) * pageSize}} to {{ math.min((page-1) * pageSize + pageSize, tasks.length)}} of {{tasks.length}}</p>.
This creates a local copy of Math without needing to create extra functions and getters
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With