Currently, my code looks like this:
swal({
title: 'Loading cars from data base',
showLoaderOnConfirm: true,
preConfirm: () => {
return this.carsSvc.getCars().then((cars: ICar[]) => {
this.setData(cars);
resolve();
});
}
});
The code above displays an alert that requires a confirmation before showing a loading icon and closing when the loading process completes. However, I am only interested in the loading part of this action without the need for manual confirmation. Ideally, I would like the loading process to start as soon as the alert is opened and automatically close upon completion. Is there a way to achieve this using SweetAlert2?