I have a page, containing a lot of items (observablearray), so I've created a paging system. (Well, not created myself, but copied from here How to handle pagination with Knockout ;) )
I want to show the individual buttons per page. Something like:
< 1 2 3 4 >
I have the "totalPages" property, but how can I use that in on the frontend?
How can I loop through a knockout int-variable and create links to a function with that same int?
I was hoping something like this:
<ul data-bind="foreach: totalPages">
<li><a href="#" data-bind="text: $index, click: pageNumber($index)"></li>
</ul>
but that doesn't work.