diff --git a/src/app/dashboard/add-data.component.html b/src/app/dashboard/add-data.component.html index e5ee80f..c413237 100644 --- a/src/app/dashboard/add-data.component.html +++ b/src/app/dashboard/add-data.component.html @@ -25,15 +25,33 @@
- +
-
- +
+
+
+ +
+
+ +
+
+
+
+ +
+
- Optional: Choose the relevant Category for the purchase. + Optional: Choose the Budget Type for the majority of the purchase.
diff --git a/src/app/dashboard/add-data.component.ts b/src/app/dashboard/add-data.component.ts index 6d64ca8..48622bf 100644 --- a/src/app/dashboard/add-data.component.ts +++ b/src/app/dashboard/add-data.component.ts @@ -39,7 +39,8 @@ export class AddDataComponent implements OnInit { transactionFormInvalid = true; myDate: any; minDate: any; - categoryIdList: number[] = []; + leftCategoryIdList: number[] = []; + rightCategoryIdList: number[] = []; categoryNameList: string[] = []; constructor( @@ -85,8 +86,14 @@ export class AddDataComponent implements OnInit { } private setCategoryList(data: any) { - this.categoryIdList = Object.keys(data.ids).map(key => data.ids[key]); + let categoryIdList = Object.keys(data.ids).map(key => data.ids[key]); this.categoryNameList = Object.keys(data.names).map(key => data.names[key]); + console.log(categoryIdList); + let halfLength = Math.floor(categoryIdList.length / 2); + this.leftCategoryIdList = categoryIdList.splice(0, halfLength); + console.log(this.leftCategoryIdList); + this.rightCategoryIdList = categoryIdList; + console.log(this.rightCategoryIdList); } getMinDate() {