Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Button documentation contains incorrect template name for loading icon template #17462

Open
2 of 4 tasks
Andrei-NZ opened this issue Jan 22, 2025 · 0 comments
Open
2 of 4 tasks
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible

Comments

@Andrei-NZ
Copy link

Describe the bug

Looking at the v19 documentation found at https://primeng.org/button lists "loadingicon" as "Custom template of loadingicon."

Looking at the source code, this should be simply "loading" as per https://github.com/primefaces/primeng/blob/248249e44338817e2d1f3b6d4ec72d9f24c35280/packages/primeng/src/button/button.ts look for loadingIconTemplate.

It looks like there is interface at https://github.com/primefaces/primeng/blob/248249e44338817e2d1f3b6d4ec72d9f24c35280/packages/primeng/src/button/button.interface.ts look for ButtonTemplates.

Since this interface (ButtonTemplates) does not seem to be enforced, there is a mismatch between documentation and source code.

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

Not sure about the best way to fix this... Maybe eradicate "magic strings" globally and replace @ContentChild('loading') with reference to interface properties somehow or find another way to generate documentation?

Reproducer

https://stackblitz.com/edit/github-l64x4naa?file=src%2Fapp%2Fapp.component.html

Environment

Mac M1 ARM64

Angular version

18,19

PrimeNG version

v19

Node version

ANY

Browser(s)

Any

Steps to reproduce the behavior

  1. View documentation at https://primeng.org/button, templates section, note template name for loading icon
  2. Declare p-button with [loading]="true" and loading icon template using template name taken from the documentation
  3. Observe loading icon template not being used

Expected behavior

Observe loading icon template to be used instead of default loading icon

@Andrei-NZ Andrei-NZ added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Projects
None yet
Development

No branches or pull requests

1 participant