angular-hotel-manager/src/app/hotel-form/hotel-form.component.html

12 lines
744 B
HTML

<p>hotel-form works!</p>
<form [formGroup]="hotelForm">
<label for="name">Name</label>
<input type="text" class="border-red-500" [class.border-8]='hotelForm.get("name")?.invalid' id="name" formControlName="name">
<label for="description">Description</label>
<input type="text" class="border-red-500" [class.border-8]='hotelForm.get("description")?.invalid' id="description" formControlName="description">
<label for="price">Price</label>
<input type="price" class="border-red-500" [class.border-8]='hotelForm.get("price")?.invalid && hotelForm.get("price")?.touched' id="price" formControlName="price">
<button (click)="submit()" [disabled]="!hotelForm.valid" type="submit">Submit</button>
<a routerLink="/">Cancel</a>
</form>