FontAwesome icons in Primeng Panel Menu Module

584 Views Asked by At

How to add fontawesome icons to Primeng Panel Menu Module. I tried various ways using CSS, adding it in the items array of Primeng nothing is working. Assigning the icon to the icon value in the items array.

app.component.ts

this.items = [
  {
    label: 'DASHBOARD',
    icon: 'custom-icon',
  },
  {
    label: 'ACCOUNTS',
    icon: 'faUserTag',
    items: [
      {
        label: 'ENTERPRISE ACCOUNTS',
        icon: 'pi pi-fw pi-align-left'
      },
      {
        label: 'USER ACCOUNTS',
        icon: 'pi pi-fw pi-align-right'
      },
    ]
  },
  {
    label: 'DEVICES',
    icon: 'pi pi-fw pi-pencil'
  },
  {
    label: 'LOGS',
    icon: 'pi pi-fw pi-pencil'
  },
  {
    label: 'OTA',
    icon: 'pi pi-fw pi-pencil',
    // routerLink: ['ota']
  },
]

app.component.html

<p-panelMenu id="test" [model]="items" >
  </p-panelMenu>
0

There are 0 best solutions below