-
+
+
+
Cuotas
-
+
+
+
+
+ Campo requerido*
+
+
+ Solo números*
+
@@ -81,7 +127,8 @@
diff --git a/src/app/components/pago-con-tarjeta/pago-con-tarjeta.component.ts b/src/app/components/pago-con-tarjeta/pago-con-tarjeta.component.ts
index 7f9552d..ac66d4a 100644
--- a/src/app/components/pago-con-tarjeta/pago-con-tarjeta.component.ts
+++ b/src/app/components/pago-con-tarjeta/pago-con-tarjeta.component.ts
@@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core';
import { BsModalRef } from 'ngx-bootstrap';
import { TarjetasService } from 'src/app/services/tarjetas.service';
import { Tarjeta } from 'src/app/wrappers/tarjeta';
+import { FormGroup, FormControl, Validators } from '@angular/forms';
@Component({
selector: 'app-pago-con-tarjeta',
@@ -10,10 +11,11 @@ import { Tarjeta } from 'src/app/wrappers/tarjeta';
})
export class PagoConTarjetaComponent implements OnInit {
- private tarjetas: Tarjeta[] = [];
- private tarjetaSeleccionada: Tarjeta;
private showForm = false;
private importeTotal: number;
+ private tarjetas: Tarjeta[] = [];
+ private tarjetaSeleccionada: Tarjeta;
+ private form: FormGroup;
constructor(
private modalRef: BsModalRef,
@@ -27,6 +29,17 @@ export class PagoConTarjetaComponent implements OnInit {
this.tarjetas = res;
}, err => console.error(err));
+
+ this.setForm();
+ }
+
+ setForm() {
+
+ this.form = new FormGroup({
+ terminal: new FormControl('', [Validators.required, Validators.pattern("^[0-9]*$")]),
+ numeroCupon: new FormControl('', [Validators.required, Validators.pattern("^[0-9]*$")]),
+ cuotas: new FormControl('', [Validators.required, Validators.pattern("^[0-9]*$")]),
+ })
}
seleccionarTarjeta(tarjeta: Tarjeta) {