Right now I have this code:
swal({
title: 'Loading cars from data base',
showLoaderOnConfirm: true,
preConfirm: () => {
return this.carsSvc.getCars().then((cars: ICar[]) => {
this.setData(cars);
resolve();
});
}
});
This code shows an alert, I have to press 'confirm' and then it shows a loading icon and closes when the loading is finished. I want only the last part of this action, so I don't want to have to confirm the loading before it begins to load. I want the loading to start when the alert is opened and to close automatically when the loading is finished. Is this possible with SweetAlert2?