Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created November 25, 2019 22:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/a91f7ff5742870a00286efd21dd33962 to your computer and use it in GitHub Desktop.
Save parzibyte/a91f7ff5742870a00286efd21dd33962 to your computer and use it in GitHub Desktop.
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