Skip to content

Can't get the AJAX loader animation to work #64

@RipleWare

Description

@RipleWare

I am unable to get the showLoaderOnConfirm animation working in both ngSweetAlert or ngSweetAlert2 using the following syntax:

swal({
                title: 'Forgot Password?', 
                text: 'Enter your email address and your password will be reset and emailed to you.', 
                input: 'email', 
                showCancelButton: true, 
                confirmButtonText: 'Send', 
                confirmButtonColor: "#DD6B55", 
                inputPlaceholder: 'Email address', 
                showLoaderOnConfirm: true, 
                preConfirm: function( email ) {
                    return new Promise(function( resolve, reject ) {

                        setTimeout(function() {

                            AccountFactory.resetAccount( email )
                                .then(function( data ) {

                                    swal({
                                        title: 'Success!', 
                                        text: 'A verification email has been sent to ' + email, 
                                        type: 'success', 
                                        confirmButtonText: 'Close', 
                                        allowEscapeKey: false
                                    });

                                }, function() {

                                    swal({
                                        title: 'Email not found', 
                                        text: 'Sorry, but we could not find an account matching that email address.', 
                                        type: 'error', 
                                        confirmButtonText: 'Close', 
                                        allowEscapeKey: true
                                    });

                                });

                        }, 2000 );

                    });
                }, 
                allowOutsideClick: false
            });

I understand preConfirm was introduced in ngSweetAlert2, but the showLoaderOnConfirm was not working for me in version 1 either, hence moving to version 2.

I'm just wondering if this functionality is actually supported in the Angular wrappers, or I'm doing something wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions