feat: add history functionality
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
surtur 2020-11-24 17:53:23 +01:00
parent 5146b9f04d
commit 821a8505cc
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D
2 changed files with 14 additions and 2 deletions

@ -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)
{

@ -7,5 +7,9 @@
</ion-header>
<ion-content [fullscreen]="true">
<ion-list>
<ion-item *ngFor="let record of historyArray; let i = index">
<ion-label>{{ record.inputHistory }} <ion-icon name="arrow-forward-outline"></ion-icon> {{ record.outputHistory }}</ion-label>
</ion-item>
</ion-list>
</ion-content>