Correct item create form

This commit is contained in:
Rene Vergara 2021-11-23 14:44:46 -06:00
parent 2596c36289
commit 55dc475a6a
1 changed files with 7 additions and 4 deletions

View File

@ -1,15 +1,18 @@
<h2 mat-dialog-title class="text">Add item</h2>
<mat-dialog-content [formGroup]="form">
<mat-form-field class="text">
<mat-form-field class="text" appearance="outline">
<mat-label>Item</mat-label>
<input type="hidden" formControlName="id">
<input matInput placeholder="Item" formControlName="name">
</mat-form-field>
<mat-form-field class="text">
<mat-form-field class="text" appearance="outline">
<mat-label>Description</mat-label>
<textarea matInput placeholder="Description" formControlName="description"></textarea>
</mat-form-field>
<mat-form-field class="text">
<input matInput type="number" placeholder="Price in USD" formControlName="cost">
<mat-form-field class="text" appearance="outline">
<mat-label>Price</mat-label>
<input matInput type="number" placeholder="Price" formControlName="cost">
<div *ngIf="!form.controls['cost'].valid && form.controls['cost'].touched">
<div *ngIf="form.controls['cost'].errors?.pattern">Use only numbers</div>
</div>