Skip to content

Commit d25ca05

Browse files
committed
feat(pagination): Added possibility to define the options for the items per page select
1 parent b0fca16 commit d25ca05

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

src/pagination/pagination.component.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,12 @@ import { ExperimentalService } from "./../experimental.module";
7171
[(ngModel)]="itemsPerPage"
7272
class="bx--select-input"
7373
aria-describedby="false">
74-
<option class="bx--select-option" value="10">10</option>
75-
<option class="bx--select-option" value="20">20</option>
76-
<option class="bx--select-option" value="30">30</option>
77-
<option class="bx--select-option" value="40">40</option>
78-
<option class="bx--select-option" value="50">50</option>
74+
<option
75+
class="bx--select-option"
76+
*ngFor="let option of itemsPerPageOptions"
77+
[value]="option">
78+
{{ option }}
79+
</option>
7980
</select>
8081
<!-- old icon -->
8182
<svg
@@ -321,6 +322,13 @@ export class Pagination {
321322
}
322323
}
323324

325+
/**
326+
* Options for items per page select
327+
*
328+
* A default array of options will be defined: [10, 20, 30, 40, 50]
329+
*/
330+
@Input() itemsPerPageOptions: number[] = [10, 20, 30, 40, 50];
331+
324332
/**
325333
* Emits the new page number.
326334
*

0 commit comments

Comments
 (0)