0

Am working on an application whereby I have a sweet alert dialog box to display to a user when h/she clicks on Payment button, I want to display a font-awesome spinner on the sweet alert dialog box besides the text property but it shows the font-awesome code instead on the loading spinner:

Sweet alert code

  swal({
        title: "Message Sent",
        icon: '{{ asset('assets/images/mpesa.png')}}',
        imageWidth: 30,
        imageHeight: 30,
        imageAlt: 'Mpesa Icon',
        text: "Please Check your Phone for a payment dialogue" + '<i class="fa fa-spinner fa-spin"></i>',
        closeOnClickOutside: false,
        buttons:false
    });
Martin
  • 547
  • 2
  • 11
  • 40

1 Answers1

0

You must use content option instead of text and set it to some DOM node as described in the documentation. Refer to this question on how to create a DOM node from HTML string.

Furgas
  • 2,729
  • 1
  • 18
  • 27