An Ember project I’m working on needed a simple set of links to move through a paginated JSON API. There are a few pagination-related addons out there, but they tend to want to deal with your data and model collections, as well as the display of pagination links. I was looking for something that would simply update the page parameter sent to the back end, and display links to other pages accordingly. The task seemed like the perfect excuse to build my first fully fledged Ember addon, ember-pagination-links.
By default, the addon creates a set of basic links with a configuration maximum number of pages to display at once, and arrows for navigating page by page and to the start and end of the list:
Each number except the current page is a link that will invoke an action, passing it the clicked value. Everything is classed for easy styling, and the icons to use for arrows and ellipses are configurable strings: