Skip to content

Commit

Permalink
Merge pull request #14270 from nicohenao/fix-paginator-dropdown-item-…
Browse files Browse the repository at this point in the history
…template

Fix #14269: Add an optional property for a custom template to be used in the paginator's "jump to page" dropdown items
  • Loading branch information
cetincakiroglu authored Mar 22, 2024
2 parents 7f9de49 + e420363 commit 15b017b
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 @@ -78,6 +78,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>
<ng-template pTemplate="dropdownicon" *ngIf="dropdownIconTemplate">
<ng-container *ngTemplateOutlet="dropdownIconTemplate"></ng-container>
</ng-template>
Expand Down Expand Up @@ -232,6 +237,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 @@ -243,7 +254,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 15b017b

Please sign in to comment.