added block detail page (placeholder)

This commit is contained in:
Darren Nelsen 2017-07-25 15:21:58 -04:00
parent b5a76aee44
commit a6ab615a96
5 changed files with 68 additions and 4 deletions

View File

@ -0,0 +1,19 @@
<!--
Generated template for the BlockDetailPage page.
See http://ionicframework.com/docs/components/#navigation for more info on
Ionic pages and navigation.
-->
<ion-header>
<ion-navbar>
<ion-title>BlockDetail</ion-title>
</ion-navbar>
</ion-header>
<ion-content padding>
Hey, here's where the BlockDetail should go.
</ion-content>

View File

@ -0,0 +1,16 @@
import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { BlockDetailPage } from './block-detail';
@NgModule({
declarations: [
BlockDetailPage,
],
imports: [
IonicPageModule.forChild(BlockDetailPage),
],
exports: [
BlockDetailPage
]
})
export class BlockDetailPageModule {}

View File

@ -0,0 +1,3 @@
page-block-detail {
}

View File

@ -0,0 +1,26 @@
import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
/**
* Generated class for the BlockDetailPage page.
*
* See http://ionicframework.com/docs/components/#navigation for more info
* on Ionic pages and navigation.
*/
@IonicPage({
name: 'block-detail'
})
@Component({
selector: 'page-block-detail',
templateUrl: 'block-detail.html',
})
export class BlockDetailPage {
constructor(public navCtrl: NavController, public navParams: NavParams) {
}
ionViewDidLoad() {
console.log('ionViewDidLoad BlockDetailPage');
}
}

View File

@ -16,8 +16,7 @@ export class BlocksPage {
public q: string;
public badQuery: boolean = false;
constructor(private nav: NavController, private http: Http, private blocksService: BlocksService) {
this.nav = nav;
constructor(public navCtrl: NavController, private http: Http, private blocksService: BlocksService) {
this.title = 'Blocks';
this.blocks = blocksService.latestBlocks;
// this.blocks.subscribe((blocks) => {
@ -48,10 +47,11 @@ export class BlocksPage {
},
(err) => {
this.http.get(apiPrefix + 'block-index/' + this.q).subscribe(
(data) => {
function (data) {
this.resetSearch();
console.log('block-index', data);
},
this.navCtrl.push('block-detail');
}.bind(this),
function (err) {
this.loading = false;
this.reportBadQuery();