created for validation and save button logic
This commit is contained in:
parent
2c0a8da60d
commit
627bdcbd80
3 changed files with 44 additions and 21 deletions
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue