Skip to content

pTemplate directive documented yet not referenced in example #18055

Open
@todaszy

Description

@todaszy

Describe the bug

In https://primeng.org/selectbutton#template (v19):

"Template
For custom content support define a ng-template with pTemplate where the local ng-template variable refers to an option in the options collection."

It mentions "pTemplate" yet it is never used in an example:

<p-selectbutton [options]="justifyOptions" [(ngModel)]="value" optionLabel="justify">
    <ng-template #item let-item>
        <i [class]="item.icon"></i>
    </ng-template>
</p-selectbutton>

Also, what this is even doing? After upgrading from v17 to v19 this stopped working:
<ng-template pTemplate let-item>
I had to do to fix it:
<ng-template #item let-item>
No idea why... I hoped that docs will explain this but now I'm confused.

Pull Request Link

No response

Reason for not contributing a PR

  • Lack of time
  • Unsure how to implement the fix/feature
  • Difficulty understanding the codebase
  • Other

Other Reason

No response

Reproducer

https://stackblitz.com/edit/jvpq5g71?file=src%2Fapp%2Fselect-button-template-demo.html

Environment

documentation

Angular version

19

PrimeNG version

v19

Node version

22

Browser(s)

chrome

Steps to reproduce the behavior

Documentation mentioned doesn't make sense.

Expected behavior

Documentation mentioned explains "pTemplate" and shows appropriate example.

Metadata

Metadata

Assignees

Labels

Component: DocumentationIssue or pull request is related to Documentation

Type

No type

Projects

Status

Review

Relationships

None yet

Development

No branches or pull requests

Issue actions