Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created November 25, 2019 19:06
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/9bc053a1dff6cbbf0d4a7a03dce2a291 to your computer and use it in GitHub Desktop.
Save parzibyte/9bc053a1dff6cbbf0d4a7a03dce2a291 to your computer and use it in GitHub Desktop.
import { Component, OnInit } from "@angular/core";
import { Mascota } from "../mascota";
@Component({
selector: "app-formulario-mascota",
templateUrl: "./formulario-mascota.component.html",
styleUrls: ["./formulario-mascota.component.css"]
})
export class FormularioMascotaComponent implements OnInit {
// El modelo ligado al formulario, por defecto vacío
mascotaModel = new Mascota("", "", undefined);
constructor() {}
ngOnInit() {}
formularioEnviado(){
/*
Aquí el formulario ha sido enviado, ya sea
por presionar el botón, presionar Enter, etcétera
*/
console.log("El formulario fue enviado y la mascota es: ", this.mascotaModel)
alert("Enviado");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment