From 5146b9f04dbadf220160a5bfe29fce27cffeb015 Mon Sep 17 00:00:00 2001 From: surtur Date: Tue, 10 Nov 2020 19:39:35 +0100 Subject: [PATCH] chore: grab history records (prepare for show-off) --- src/app/tab2/tab2.page.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/app/tab2/tab2.page.ts b/src/app/tab2/tab2.page.ts index dd8aa97..ced7731 100644 --- a/src/app/tab2/tab2.page.ts +++ b/src/app/tab2/tab2.page.ts @@ -1,5 +1,6 @@ import { Component } from '@angular/core'; -import { Storage } from '@ionic/storage'; +import { HistoryService } from '../api/history.service'; +import { HistoryRecord } from '../models/history-record.model'; @Component({ selector: 'app-tab2', @@ -8,6 +9,12 @@ import { Storage } from '@ionic/storage'; }) export class Tab2Page { - constructor(private storage: Storage) {} + historyArray: HistoryRecord[] + constructor(private historyService: HistoryService) {} + ionViewWillEnter() + { + console.log('Method ionViewWillEnter was called.'); + this.historyArray = this.historyService.getRecord(); + } }