created for validation and save button logic

This commit is contained in:
Joe Arndt 2026-02-14 10:20:23 -06:00
parent 2c0a8da60d
commit 627bdcbd80
3 changed files with 44 additions and 21 deletions

View file

@ -15,12 +15,12 @@
<mat-form-field appearance="outline">
<mat-label>Cents</mat-label>
<input type="number" matInput [formField]="expenseForm.amount">
<input type="number" matInput [formField]="expenseForm.cents">
</mat-form-field>
<mat-form-field appearance="outline">
<mat-label>Category</mat-label>
<input type="text" matInput [matAutocomplete]="categoryAuto" [formField]="expenseForm.categoryId">
<input type="text" matInput [matAutocomplete]="categoryAuto" [formField]="expenseForm.category">
<mat-autocomplete autoActiveFirstOption #categoryAuto="matAutocomplete">
@for (category of categories(); track category.id) {
<mat-option [value]="category.name">{{ category.name }}</mat-option>
@ -30,7 +30,7 @@
<mat-form-field appearance="outline">
<mat-label>Merchant</mat-label>
<input type="text" matInput [matAutocomplete]="merchantAuto" [formField]="expenseForm.merchantId">
<input type="text" matInput [matAutocomplete]="merchantAuto" [formField]="expenseForm.merchant">
<mat-autocomplete autoActiveFirstOption #merchantAuto="matAutocomplete">
@for (merchant of merchants(); track merchant.id) {
<mat-option [value]="merchant.name">{{ merchant.name }}</mat-option>
@ -51,14 +51,14 @@
<mat-form-field appearance="outline" class="add-expense-note">
<mat-label>Note</mat-label>
<textarea rows="1" matInput></textarea>
<textarea rows="1" matInput [formField]="expenseForm.note"></textarea>
</mat-form-field>
</div>
</mat-card-content>
<mat-card-footer class="add-expense-footer">
<mat-card-actions>
<button matButton="tonal" disabled="true">Save</button>
<button matButton="tonal" [disabled]="!enableSaveButton()" (click)="saveClick()">Save</button>
</mat-card-actions>
</mat-card-footer>
</mat-card>