Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Upgrade to Nebular 4 has stopped displaying font awesome icons. Setting pack is also not working

After upgrade of Angular version 8, Nebular got updated to version 4. After the upgrade I cannot see my font awesome icons that was getting displayed earlier.

I tried going through this document of nebular which is asking us to register font awesome as default pack. But even doing this it is not working. https://akveo.github.io/nebular/docs/guides/register-icon-pack#register-icon-pack.

Could not find enough discussion on this issue. Font awesome is already included and also I have added it inside my angular.json file

constructor(private iconService: NbIconLibraries) {
    this.iconService.registerFontPack('font-aweome');
    this.iconService.setDefaultPack('font-aweome');
}

Nebular should accept font-awesome icons.

like image 494
Rohit Dubey Avatar asked Mar 04 '23 16:03

Rohit Dubey


1 Answers

In order to display fontawesome you will need to register icon packs and upgrade your nebular version to 4.6.0. In order to register icon pack you need to do this in app.component.ts

constructor(private iconLibraries: NbIconLibraries){ this.iconLibraries.registerFontPack('font-awesome', { packClass: 'fa' }); }

then in the menu Items you can use it like this

{ title: 'wallet', icon: { icon: 'fa-eur', pack: 'font-awesome' }, link: '/home/dashboard', }

Hopefully this helps.

like image 192
Agha Ali Abbas Avatar answered May 04 '23 23:05

Agha Ali Abbas