I want to display Add and Delete button in the panel header. Below code displays button with no fa-icon and no label
<p-panel>
<p-header>
<div>
Registration Form
<button type="button" pButton icon="fa-plus" style="float:right" label="Add">
</button>
</div>
</p-header>
</p-panel>
Your code is working fine here.
Have you imported font-awesome
to your application? If not, add this in your index.html
within the <head></head>
tag.
<head>
...
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
</head>
Also, you will need to import ButtonModule, PanelModule
to your application.
import {ButtonModule, PanelModule} from 'primeng';
@NgModule({
imports: [
...
ButtonModule,
PanelModule,
...
],
...
})
After importing the BrowserAnimationsModule , primeng Buttons are displaying inside the panel.
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With