Skip to content

Instantly share code, notes, and snippets.

@taylor8294
taylor8294 / mypanelmenu.component.ts
Created February 4, 2019 20:39
How to add badges to PrimeNG panelMenu MenuItem's
/**
* Usage: just add "add-badge-X badge-class-Y" to the icon proporty of the item.
* Where "X" is any content for the badge (eg. "add-badge-1" "add-badge-unread-mail" "add-badge-!" etc) can use anything
* separate words with a dash ("-") and if you want to use a dash in the badge content just escape it with a backslash
* (eg "add-badge-ages-16\\-24").
* Where "Y" is any Bootstrap style class (eg. "info", "danger", etc)
* Requires bootstrap/_badges.scss
*/
import { Component, OnInit, AfterViewInit } from '@angular/core';