Skip to content

Commit 8322ee6

Browse files
committed
validar formulario
1 parent a259c20 commit 8322ee6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

presupuesto-app/src/app/formulario/formulario.component.html

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<form>
1+
<form (ngSubmit)="f.form.valid && agregarValor()" #f="ngForm">
22
<div class="agregar">
33
<div class="agregar_contenedor">
44
<select
@@ -16,6 +16,7 @@
1616
class="agregar_descripcion"
1717
placeholder="Agregar Descripción"
1818
[(ngModel)]="descripcionInput"
19+
required
1920
/>
2021
<input
2122
[ngClass]="{ redfocus: tipo === 'egr' }"
@@ -24,11 +25,13 @@
2425
class="agregar_valor"
2526
placeholder="Valor"
2627
[(ngModel)]="valorInput"
28+
required
2729
/>
28-
<button class="agregar_btn" (click)="agregarValor()">
30+
<button type="submit" class="agregar_btn">
2931
<i
3032
[ngClass]="{ red: tipo === 'egr' }"
3133
class="ion-ios-checkmark-outline"
34+
(click)="agregarValor()"
3235
></i>
3336
</button>
3437
</div>

0 commit comments

Comments
 (0)