- {{ categoryNameList[categoryEntry.category - 1] || 'Uncategorised' }}
+ {{ categoryList[categoryEntry.category] || 'Uncategorised' }}
{{ ( categoryEntry.value || 0 ) | currency:'GBP':'symbol':'1.2-2' }}
({{ (categoryEntry.value || 0 ) / weekListValueSum4 | percent:'1.0-0' }})
diff --git a/src/app/dashboard/category-month.component.ts b/src/app/dashboard/category-month.component.ts
index 809e71f..140e8e3 100644
--- a/src/app/dashboard/category-month.component.ts
+++ b/src/app/dashboard/category-month.component.ts
@@ -31,15 +31,13 @@ export class CategoryMonthComponent implements OnInit {
weekEssential3: number = 0;
weekEssential4: number = 0;
- categoryList: number[] = [];
+ categoryList: any;
dayList: any[] = [];
valueList: number[] = [];
myWeek1: any;
myWeek2: any;
myWeek3: any;
myWeek4: any;
- categoryIdList: number[] = [];
- categoryNameList: string[] = [];
categoryLimit1: number = 6;
categoryLimit2: number = 6;
categoryLimit3: number = 6;
@@ -51,7 +49,8 @@ export class CategoryMonthComponent implements OnInit {
this.setDate();
this.api.categoryList().subscribe(
result => {
- this.setCategoryList(result.categories);
+ this.categoryList = result.categories;
+ console.log('Category List received');
},
error => {
console.log('Retrieval Error');
@@ -72,11 +71,6 @@ export class CategoryMonthComponent implements OnInit {
ngOnInit(): void {
}
- private setCategoryList(data: any) {
- this.categoryIdList = Object.keys(data.ids).map(key => data.ids[key]);
- this.categoryNameList = Object.keys(data.names).map(key => data.names[key]);
- }
-
private setDate () {
this.myWeek1 = moment().startOf('isoWeek').format('YYYY-MM-DD');
this.myWeek2 = moment(this.myWeek1).subtract(1, 'weeks').format('YYYY-MM-DD');
diff --git a/src/app/dashboard/transaction-log.component.html b/src/app/dashboard/transaction-log.component.html
index 5e7dde2..d24c301 100644
--- a/src/app/dashboard/transaction-log.component.html
+++ b/src/app/dashboard/transaction-log.component.html
@@ -50,7 +50,7 @@
Select a Recurring Transaction below to edit it.
-
+