Fixed app, added ability for non category transaction changed reset form

This commit is contained in:
piratefinn 2018-01-16 15:57:38 +00:00
parent d17a686490
commit 511969656e
2 changed files with 3 additions and 5 deletions

View file

@ -29,7 +29,7 @@
<div class="col-md-9">
<div class="input-group">
<select type="text" class="form-control" [(ngModel)]="categoryId">
<option value="" disabled>Choose a category</option>
<option value="">Uncategorised</option>
<option *ngFor="let category of categoryIdList, let i=index" [ngValue]="category" >
{{ categoryNameList[i] }}
</option>

View file

@ -30,7 +30,8 @@ export class AddDataComponent implements OnInit {
organisationTown: string;
organisationPostcode: string;
amount: number;
categoryId: number;
// Assumes Groceries is 1st category
categoryId: number = 1;
transactionAdditionType = 1;
storeList = [];
showAddStore = false;
@ -69,8 +70,6 @@ export class AddDataComponent implements OnInit {
// this.myDate = new Date().toISOString().slice(0, 16);
this.api.categoryList().subscribe(
result => {
this.categories = result;
console.log(this.categories);
this.setCategoryList(result.categories);
},
error => {
@ -261,7 +260,6 @@ export class AddDataComponent implements OnInit {
this.amount = null;
this.transactionFormInvalid = true;
this.showAddStore = false;
this.categoryId = null;
}
onSubmitPayroll() {