Hey!
I had to implement a pagination, where instead of page numbers, specific strings need to be displayed (first three letters of first and last item in the page). The only way to do it, was to tweak makePage function.
Currently the function is:
// Create page object used in template
function makePage(number, text, isActive) {
return {
number: number,
text: text,
active: isActive
};
}
And when it is called, the number is passed as a text:
// Add page number links
for (var number = startPage; number <= endPage; number++) {
var page = makePage(number, number, number === currentPage);
pages.push(page);
}
So what I did, is added an extra attribute to the directive, to which I can pass an array with the pagination indexes (separately prepared in a backend, with same size as number of total pages). These values are added when the page is created.
Do you you think it could be a good idea, to add the new attribute, which can be responsible for overriding default number pages? In that case, of course, preparation of valid values for override is a developer's responsibility.