I was trying to experiment with navigation with Ionic 2. I started with the Hello Ionic starter application and added a page with ion-tabs and 3 ion-tab’s. When I run it the page with the ion-tabs just shows up as solid black.
My example project is here: https://github.com/abierbaum/ionic2_test/tree/ion_tabs_bug
The new components are:
tabs-page.html
<ion-tabs>
<ion-tab tabIcon="water" [root]="tabCmp" [rootParams]="tabOne"></ion-tab>
<ion-tab tabIcon="angular" [root]="tabCmp" [rootParams]="tabTwo"></ion-tab>
<ion-tab tabIcon="cloud" [root]="tabCmp" [rootParams]="tabThree"></ion-tab>
</ion-tabs>
tabs-page.ts
import { Component } from '@angular/core';
import {
NavController,
} from 'ionic-angular';
import {
TabContent,
} from './tab-content';
@Component({
templateUrl: 'tabs-page.html',
})
export class TabsPage {
navCtrl: NavController;
tabCmp: TabContent;
tabOne = {name: 'Tab 1'};
tabTwo = {name: 'Tab 2'};
tabThee = {name: 'Tab 3'};
constructor(navCtrl: NavController) {
this.navCtrl = navCtrl;
}
}
tab-content.html
<ion-header>
<ion-navbar><ion-title>{{name}}</ion-title></ion-navbar>
</ion-header>
<ion-content>
<p>This is the tab for {{name}}</p>
</ion-content>
tab-content.ts
import { Component } from '@angular/core';
import {
NavParams,
} from 'ionic-angular';
@Component({
templateUrl: 'tab-content.html',
})
export class TabContent {
name: string = '';
constructor(navParams: NavParams) {
this.name = navParams.get('name');
}
}
Anyone see anything obvious? There are no compiler error or console log messages of note.