Paging in a select tag without the next and prev page types

128 Views Asked by At

I'm trying to create a select tag paging with the following code:

<select ng-change="params.page(page)" ng-model="page" ng-options="page.number as page.number for page in pages"></select>

But the result is this:

enter image description here

Further debugging by using the following code:

<select ng-change="params.page(page)" ng-model="page" ng-options="page.number as page.number group by page.type for page in pages"></select>

brings me to the conclusion that the previous and the next pages (located at pages.type) are also included in the pages array.

enter image description here

So my question is, how do can I fix this? Is there a way to create an alternative array of only the pages that are really only pages or a way to filter the pages array based on the given types?

1

There are 1 best solutions below

0
On BEST ANSWER

I managed to filter the "prev" and "next" page objects out of the pages array by defining a filter. I did this by adding | myFilter to the queryand adding a filter to my app.