Check out the snippet of code I'm working with:
removeAlert() : Observable<boolean> {
Swal.fire({
title: 'delete this file ?',
text: 'sth',
icon: 'warning',
showCancelButton: true,
confirmButtonText: 'ok',
cancelButtonText: 'cancel'
}).then((result) => {
if (result.value) {
return of(true);
}
else if (result.dismiss === Swal.DismissReason.cancel) {
this.showError("canceled" , "sth else");
return of(false);
}
});
//return of(false);
}
I'm trying to figure out how to observe the value after a click and return it.
Specifically, I need help with this part if(result.value)