From 821a8505cca220e5d119e957541bd4a85fa2c61d Mon Sep 17 00:00:00 2001 From: surtur Date: Tue, 24 Nov 2020 17:53:23 +0100 Subject: [PATCH] feat: add history functionality --- src/app/api/history.service.ts | 10 +++++++++- src/app/tab2/tab2.page.html | 6 +++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/app/api/history.service.ts b/src/app/api/history.service.ts index 0496674..d43ea74 100644 --- a/src/app/api/history.service.ts +++ b/src/app/api/history.service.ts @@ -9,7 +9,15 @@ export class HistoryService { historyArray: HistoryRecord[] = [] - constructor(private storage: Storage) { } + constructor(private storage: Storage){ + storage.get('history').then((val) => + { + if(val) + { + this.historyArray = JSON.parse(val); + } + }); + } public saveRecord(record: HistoryRecord) { diff --git a/src/app/tab2/tab2.page.html b/src/app/tab2/tab2.page.html index 46e4f1b..928e0eb 100644 --- a/src/app/tab2/tab2.page.html +++ b/src/app/tab2/tab2.page.html @@ -7,5 +7,9 @@ - + + + {{ record.inputHistory }} {{ record.outputHistory }} + +