pass blockHash to block detail page
This commit is contained in:
parent
a6ab615a96
commit
013358a69c
@ -7,13 +7,27 @@
|
||||
<ion-header>
|
||||
|
||||
<ion-navbar>
|
||||
<ion-title>BlockDetail</ion-title>
|
||||
<ion-title>Block Detail</ion-title>
|
||||
</ion-navbar>
|
||||
|
||||
</ion-header>
|
||||
|
||||
|
||||
<ion-content padding>
|
||||
Hey, here's where the BlockDetail should go.
|
||||
|
||||
<p>Block #</p>
|
||||
<p>BlockHash {{ blockHash }}</p>
|
||||
<p>Summary</p>
|
||||
<p>Number of Transactions</p>
|
||||
<p>Height</p>
|
||||
<p>Block Reward</p>
|
||||
<p>Timestamp</p>
|
||||
<p>Mined by</p>
|
||||
<p>Merkle Root</p>
|
||||
<p>Previous Block</p>
|
||||
<p>Difficulty</p>
|
||||
<p>Bits</p>
|
||||
<p>Size (bytes)</p>
|
||||
<p>Version</p>
|
||||
<p>Nonce</p>
|
||||
<p>Next Block</p>
|
||||
</ion-content>
|
||||
|
||||
@ -16,7 +16,11 @@ import { IonicPage, NavController, NavParams } from 'ionic-angular';
|
||||
})
|
||||
export class BlockDetailPage {
|
||||
|
||||
blockHash: string;
|
||||
|
||||
constructor(public navCtrl: NavController, public navParams: NavParams) {
|
||||
this.blockHash = navParams.get('blockHash');
|
||||
console.log('blockHash is', this.blockHash);
|
||||
}
|
||||
|
||||
ionViewDidLoad() {
|
||||
|
||||
@ -50,7 +50,11 @@ export class BlocksPage {
|
||||
function (data) {
|
||||
this.resetSearch();
|
||||
console.log('block-index', data);
|
||||
this.navCtrl.push('block-detail');
|
||||
let parsedData = JSON.parse(data._body);
|
||||
console.log('parsedData', parsedData);
|
||||
this.navCtrl.push('block-detail', {
|
||||
blockHash: parsedData.blockHash
|
||||
});
|
||||
}.bind(this),
|
||||
function (err) {
|
||||
this.loading = false;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user