Badge in p-tabMenu not working

Forum rules
Please note that response time for technical support is within 3-5 business days.
Post Reply
yogi45
Posts: 1
Joined: 25 Aug 2022, 11:00

31 Mar 2023, 01:04

Hi
i try to show bagde in tabMenu from RouteItems,but not Working.
this my html
<p-tabMenu styleClass="mb-5" [model]="routeItems"></p-tabMenu>

and this my component.

this.routeItems = [
{
label: 'ALL',
badge: "15",
},
{
label: 'Waiting Approval',
badge: "5",

},
{
label: 'Revision',
badge: "5",

},
{
label: 'Reject',
badge: "5",

},
];

Please Advice ..

Thank.

gucal
Posts: 50
Joined: 06 Sep 2022, 08:45

03 Apr 2023, 09:39

You can apply templating for the tab menu. View the document.

https://primeng.org/tabmenu#template

Example:

Code: Select all

<p-autoComplete [(ngModel)]="selectedCountryAdvanced" [suggestions]="filteredCountries" 
    (completeMethod)="filterCountry($event)" field="name" [dropdown]="true">
        <ng-template let-country pTemplate="item">
            <div class="flex align-items-center gap-2">
                    <p-badge [value]="country.badge"></p-badge>
                <div>{{ country.name }}</div>
            </div>
        </ng-template>
</p-autoComplete>
Aliriza Gucal
PrimeNG Core Developer

Post Reply

Return to “Apollo - PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests