diff --git a/app/src/pages/block-detail/block-detail.html b/app/src/pages/block-detail/block-detail.html
index 0c532c5..3a9e9e9 100644
--- a/app/src/pages/block-detail/block-detail.html
+++ b/app/src/pages/block-detail/block-detail.html
@@ -17,17 +17,22 @@
Block # {{ block.height }}
BlockHash {{ block.hash }}
Summary
- Number of Transactions {{ block.tx.length }}
- Height {{ block.height }}
- Block Reward {{ block.reward }}
- Timestamp {{ block.time }}
- Mined by
- Merkle Root {{ block.merkleroot }}
- Previous Block {{ block.height - 1 }}
- Difficulty {{ block.difficulty }}
- Bits {{ block.bits }}
- Size (bytes) {{ block.size }}
- Version {{ block.version }}
- Nonce {{ block.nonce }}
- Next Block {{ block.height + 1 }}
+
+
Number of Transactions {{ block.tx.length }}
+
Height {{ block.height }}
+
Block Reward {{ block.reward }}
+
Timestamp {{ block.time }}
+
Mined by
+
Merkle Root {{ block.merkleroot }}
+
Previous Block {{ block.height - 1 }}
+
Difficulty {{ block.difficulty }}
+
Bits {{ block.bits }}
+
Size (bytes) {{ block.size }}
+
Version {{ block.version }}
+
Nonce {{ block.nonce }}
+
Next Block {{ block.height + 1 }}
+
+
diff --git a/app/src/pages/block-detail/block-detail.ts b/app/src/pages/block-detail/block-detail.ts
index 56a617e..868ad92 100644
--- a/app/src/pages/block-detail/block-detail.ts
+++ b/app/src/pages/block-detail/block-detail.ts
@@ -18,6 +18,7 @@ import { Http } from '@angular/http';
})
export class BlockDetailPage {
+ public loading: boolean = true;
private blockHash: string;
public block: any = {
tx: []
@@ -25,7 +26,6 @@ export class BlockDetailPage {
constructor(public navCtrl: NavController, private http: Http, public navParams: NavParams) {
this.blockHash = navParams.get('blockHash');
- console.log('blockHash is', this.blockHash);
let apiPrefix: string = 'http://localhost:3001/insight-api/';
@@ -37,6 +37,9 @@ export class BlockDetailPage {
},
(err) => {
console.log('err is', err);
+ },
+ () => {
+ this.loading = false;
}
);
}
@@ -45,13 +48,17 @@ export class BlockDetailPage {
console.log('ionViewDidLoad BlockDetailPage');
}
- public goToPreviousBlock() {
+ public ionViewWillLeave(): void {
+ this.loading = true;
+ }
+
+ public goToPreviousBlock(): void {
this.navCtrl.push('block-detail', {
'blockHash': this.block.previousblockhash
});
}
- public goToNextBlock() {
+ public goToNextBlock(): void {
this.navCtrl.push('block-detail', {
'blockHash': this.block.nextblockhash
});