From b274b363ffe1fa15b09d5e15ea60b16c6e224612 Mon Sep 17 00:00:00 2001 From: Darren Nelsen Date: Thu, 3 Aug 2017 18:24:48 -0400 Subject: [PATCH] added search by block hash --- app/src/pages/blocksPage/blocksPage.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/pages/blocksPage/blocksPage.ts b/app/src/pages/blocksPage/blocksPage.ts index 3f75c0b..32c146e 100644 --- a/app/src/pages/blocksPage/blocksPage.ts +++ b/app/src/pages/blocksPage/blocksPage.ts @@ -31,10 +31,14 @@ export class BlocksPage { let apiPrefix: string = this.api.apiPrefix; this.http.get(apiPrefix + 'block/' + this.q).subscribe( - (data) => { + function (data: any) { this.resetSearch(); console.log('block', data); - }, + let parsedData: any = JSON.parse(data._body); + this.navCtrl.push('block-detail', { + 'blockHash': parsedData.hash + }); + }.bind(this), () => { this.http.get(apiPrefix + 'tx/' + this.q).subscribe( function (data: any) {