Font Awesome icons do not get in PrimeNG

1

I have the Awesome Font lib installed and configured in my project, and I have the PrimeNG lib installed as well, but the Awesome Font icons are not getting in the PrimeNG Datatable, it will be missing something in my HTML file or is it the project that is not well configured.

This is my page;

  <div class="ui-g">
            <div class="ui-g-12 ui-md-6">
            <p-dataTable [value]="lancamentos">
                <p-column field="pessoa" header="Nome" styleClass="col-data"></p-column>
                <p-column field="descricao" header="Descrição" styleClass="col-data"></p-column>
                <p-column field="dataVencimento" header="Valor" styleClass="col-data"></p-column>
                <p-column styleClass="col-acoes">
                        <ng-template pTemplate="body">
                          <a pButton icon="fa-pencil"></a>
                          <button pButton icon="fa-trash"></button>
                        </ng-template>
                    </p-column>
            </p-dataTable>

            </div>

This is my package.json file

"font-awesome": "4.7.0",

This is my angular-cli.json file

"styles": [
    "../node_modules/font-awesome/css/font-awesome.min.css",
    "../node_modules/admin-lte/bootstrap/css/bootstrap.min.css",
    "../node_modules/admin-lte/dist/css/AdminLTE.min.css",
    "../node_modules/admin-lte/dist/css/skins/skin-red.min.css",
    "../node_modules/admin-lte/plugins/iCheck/flat/red.css",
    "../node_modules/primeng/resources/primeng.min.css",
    "../node_modules/primeng/resources/themes/omega/theme.css",
    "styles.css"
  ],

It's showing up like this;

    
asked by anonymous 17.08.2018 / 14:03

3 answers

1

In the icon property put it this way.

icon="fa fa-pencil"

This should resolve.

    
18.08.2018 / 16:26
0

If you install via NPM, I think the correct import looks like this:

"styles": [
"../node_modules/font-awesome/css/font-awesome.css" ],
    
17.08.2018 / 14:13
0

It depends on the version of your PrimeNG, if it does not support FontAwesome, you have to use your own PrimeNG ex library: "pi pi-save"

    
21.09.2018 / 12:21