Correct item create form

This commit is contained in:
Rene Vergara 2021-11-23 14:44:46 -06:00
parent 2596c36289
commit 55dc475a6a

View file

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