0

Is it possible to use an angular-fontawesome icon inside a sweetalert2 title? I tried this but it doesn't work, the icon doesn't show and the inspector show size 0x0. I tried overriding the styles but I'm not very good with CSS.

swal.fire({
       title:  "<fa-icon [icon]="faBug" [border]="true" size="6x"></fa-icon>"
ouflak
  • 2,458
  • 10
  • 44
  • 49

1 Answers1

0

Please refer to the official documentation to learn how to pass icon to an arbitrary JavaScript library and why what you have attempted to do does not work.

Below is an example from there:

import { icon } from '@fortawesome/fontawesome-svg-core';
import { faChevronLeft, faChevronRight } from '@fortawesome/free-solid-svg-icons';

myTooltipLib({
    content: `<p><b>Hint:</b> You can navigate items with ${icon(faChevronLeft).html.join('')} and ${icon(faChevronRight).html.join('')} buttons.</p>`
})
Yaroslav Admin
  • 13,880
  • 6
  • 63
  • 83
  • Thanks. I completely overlooked that section in the documentation, and had to read it twice to understand how it works. It's embarrassing how simple it is. – MumiaIrrequieta Nov 22 '21 at 18:00