Skip to content

Commit

Permalink
add an optional custom template reference to the paginator's jump to …
Browse files Browse the repository at this point in the history
…page dropdown items
  • Loading branch information
nicohenao committed Dec 4, 2023
1 parent a5d3bf2 commit 3a176df
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/app/components/paginator/paginator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ import { PaginatorState } from './paginator.interface';
[scrollHeight]="dropdownScrollHeight"
>
<ng-template pTemplate="selectedItem">{{ currentPageReport }}</ng-template>
<ng-container *ngIf="jumpToPageItemTemplate">
<ng-template let-item pTemplate="item">
<ng-container *ngTemplateOutlet="jumpToPageItemTemplate; context: { $implicit: item }"> </ng-container>
</ng-template>
</ng-container>
</p-dropdown>
<button
type="button"
Expand Down Expand Up @@ -225,6 +230,12 @@ export class Paginator implements OnInit, AfterContentInit, OnChanges {
* @group Props
*/
@Input() showJumpToPageInput: boolean | undefined;
/**
* Template instance to inject into the jump to page dropdown item inside in the paginator.
* @param {Object} context - item instance.
* @group Props
*/
@Input() jumpToPageItemTemplate: TemplateRef<{ $implicit: any }> | undefined;
/**
* Whether to show page links.
* @group Props
Expand All @@ -236,7 +247,7 @@ export class Paginator implements OnInit, AfterContentInit, OnChanges {
*/
@Input() locale: string | undefined;
/**
* Template instance to inject into the dropdown item inside in the paginator.
* Template instance to inject into the rows per page dropdown item inside in the paginator.
* @param {Object} context - item instance.
* @group Props
*/
Expand Down

0 comments on commit 3a176df

Please sign in to comment.