Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
eliminarMascota(mascota: Mascota) {
this.dialogo
.open(DialogoConfirmacionComponent, {
data: `¿Realmente quieres eliminar a ${mascota.nombre}?`
})
.afterClosed()
.subscribe((confirmado: Boolean) => {
if (!confirmado) return;
this.mascotasService
.deleteMascota(mascota)
.subscribe(() => {
this.obtenerMascotas();
this.snackBar.open('Mascota eliminada', undefined, {
duration: 1500,
});
});
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment