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

Menu component templates not rendered v18.0.0-beta.4 #16765

Closed
teflonmuflon2 opened this issue Nov 16, 2024 · 4 comments
Closed

Menu component templates not rendered v18.0.0-beta.4 #16765

teflonmuflon2 opened this issue Nov 16, 2024 · 4 comments
Assignees
Labels
Resolution: Needs More Information More information about the issue is needed to find a correct solution Resolution: Stale Issue or pull request is inactivity and unfortunately it will be *closed* if there is no response
Milestone

Comments

@teflonmuflon2
Copy link

Describe the bug

the start and end tempaltes are not rendered

Environment

chrome on windows 11

Reproducer

No response

Angular version

18.2.1

PrimeNG version

18.0.0-beta.4

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

v22.11.0

Browser(s)

No response

Steps to reproduce the behavior

<p-menu [model]="items" class="flex justify-center" styleClass="w-full md:w-60">






PRIMEAPP




{{ item.label }}



<span [class]="item.icon">
{{ item.label }}
<p-badge *ngIf="item.badge" class="ml-auto" [value]="item.badge" />
<span *ngIf="item.shortcut" class="ml-auto border border-surface rounded bg-emphasis text-muted-color text-xs p-1">
{{ item.shortcut }}







Amy Elsner
Admin



Expected behavior

should display the templates

@teflonmuflon2 teflonmuflon2 added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Nov 16, 2024
@mertsincan mertsincan added Resolution: Needs More Information More information about the issue is needed to find a correct solution and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Nov 19, 2024
@mertsincan mertsincan added this to the 18.0.0-rc.2 milestone Nov 19, 2024
@mertsincan mertsincan added the Status: Pending Review Issue or pull request is being reviewed by Core Team label Nov 19, 2024
@mertsincan
Copy link
Member

Could you please attach a stackblitz link for us to replicate? Thank you!

@mertsincan mertsincan added Resolution: Stale Issue or pull request is inactivity and unfortunately it will be *closed* if there is no response and removed Status: Pending Review Issue or pull request is being reviewed by Core Team labels Nov 19, 2024
@mertsincan mertsincan removed this from PrimeNG Nov 20, 2024
@teflonmuflon2
Copy link
Author

Could you please attach a stackblitz link for us to replicate? Thank you!

i copied the demo from:
https://v18.primeng.org/menu

image

it doesn't works on the demo page either

@teflonmuflon2
Copy link
Author

teflonmuflon2 commented Nov 22, 2024

very strange. if i use @if in any of template the templates not displayed.
not working:
<ng-template let-item pTemplate="item"> @if (item?.visible !== false) { <a class="flex items-center p-menuitem-link ml-3"> <mat-icon class="{{ item?.text_color ? item?.text_color : 'text-primary' }}" fontIcon="{{ item.icon ? item.icon : 'add_circle' }}" /> <span class="ml-2 {{ item?.text_color ? item?.text_color : '' }} ">{{ item.label }}</span> @if (item?.selector) { <span class="ml-auto border surface-border bg-blue-500 text-white text-xs p-1"> {{ item?.selector }} </span> } </a> } </ng-template>

working:
<ng-template let-item pTemplate="item"> <a class="flex items-center p-menuitem-link ml-3"> <mat-icon class="{{ item?.text_color ? item?.text_color : 'text-primary' }}" fontIcon="{{ item.icon ? item.icon : 'add_circle' }}" /> <span class="ml-2 {{ item?.text_color ? item?.text_color : '' }} ">{{ item.label }}</span><span [ngClass]=" item?.selector ? 'bg-blue-500 ml-auto border surface-border text-white text-xs p-1' : '' "> {{ item?.selector }} </span> </a> </ng-template>

@teflonmuflon2
Copy link
Author

needed to use the new syntax

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Needs More Information More information about the issue is needed to find a correct solution Resolution: Stale Issue or pull request is inactivity and unfortunately it will be *closed* if there is no response
Projects
Status: Done
Development

No branches or pull requests

4 participants