Sweet alert dialog with spinner in AngularJs

13,405

The original sweet alert plugin is unsupported, I suggest you using SweetAlert2 plugin.

Migration is simple, here's the migration guide: Migration from SweetAlert to SweetAlert2

In SweetAlert2 there's swal.showLoading(), so you can show loading modal as easy as:

Swal.fire('Please wait')
Swal.showLoading()
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
Share:
13,405

Related videos on Youtube

hakuna
Author by

hakuna

FullStack developer &amp; DevSecOps engineer primarily works on Microsoft .Net,Angular2-5,AWS/Azure,HTML,CSS,SQL Server, Oracle, setting up infrastructure, configuration and deployment. Worked with various clients, business domains across multiple large/small scale projects leading/managing the teams with in US and internationally.

Updated on October 06, 2022

Comments

  • hakuna
    hakuna over 1 year

    I am trying to display a spinner in a sweet alert dialog something close to Bootstrap modal dialog (http://jsfiddle.net/D6rD6/5/)

    The closest i could come up with is something like this :

    SweetAlert.swal({
    title: '<small>Import errors occurred !</small>',
    text: '<i class="fa fa-spinner" aria-hidden="true"></i>',
    html: true,
    customClass: 'manual-upload-errors-swal-width'
    });
    

    If this is not possible whats the closest and best solution ?

  • hakuna
    hakuna over 7 years
    Is there a way i can use different spinner ?
  • Limon Monte
    Limon Monte over 7 years
    No, currently there's only this spinner implemented. To use other spinners you should hide buttons (showConfirmButton: false) and pass a custom spinner to the html paremeter.
  • Osama Khalid
    Osama Khalid over 3 years
    How do you stop it?