mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
fix tab root view load
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import {Component} from 'angular2/src/core/annotations_impl/annotations';
|
||||
|
||||
import {IonicView} from 'ionic/ionic';
|
||||
import {IonicView, NavController} from 'ionic/ionic';
|
||||
|
||||
|
||||
@Component({ selector: 'ion-app' })
|
||||
@@ -20,12 +20,12 @@ class IonicApp {
|
||||
'<ion-title>Home</ion-title>' +
|
||||
'</ion-navbar>' +
|
||||
'<ion-content class="padding">' +
|
||||
'home' +
|
||||
'</ion-content>'
|
||||
})
|
||||
class HomeTabPage {
|
||||
constructor(nav: NavController) {
|
||||
this.nav = nav;
|
||||
console.log('Initi');
|
||||
}
|
||||
push() {
|
||||
}
|
||||
@@ -38,6 +38,7 @@ class HomeTabPage {
|
||||
'<ion-title>Peek</ion-title>' +
|
||||
'</ion-navbar>' +
|
||||
'<ion-content class="padding">' +
|
||||
'peek' +
|
||||
'</ion-content>'
|
||||
})
|
||||
class PeekTabPage {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<ion-tabs id="tabs">
|
||||
<ion-tab tab-title="Home" tab-icon="ion-earth" [initial]="homeTab"></ion-tab>
|
||||
<ion-tab tab-title="Home" tab-icon="ion-earth" [initial]="peekTab"></ion-tab>
|
||||
<ion-tab tab-title="Home" tab-icon="ion-earth" [root]="homeTab"></ion-tab>
|
||||
<ion-tab tab-title="Peek" tab-icon="ion-ios-glasses" [root]="peekTab"></ion-tab>
|
||||
</ion-tabs>
|
||||
<!--
|
||||
<ion-tab tab-title="Home" tab-icon="ion-earth"></ion-tab>
|
||||
|
||||
@@ -16,7 +16,7 @@ import {Content} from '../content/content';
|
||||
@Component({
|
||||
selector: 'ion-tab',
|
||||
properties: [
|
||||
'initial',
|
||||
'root',
|
||||
'tabTitle',
|
||||
'tabIcon'
|
||||
],
|
||||
@@ -73,12 +73,12 @@ export class Tab extends ViewController {
|
||||
}
|
||||
|
||||
load(callback) {
|
||||
if (!this._loaded && this.initial) {
|
||||
if (!this._loaded && this.root) {
|
||||
let opts = {
|
||||
animate: false,
|
||||
navbar: false
|
||||
};
|
||||
this.push(this.initial, null, opts).then(() => {
|
||||
this.push(this.root, null, opts).then(() => {
|
||||
callback && callback();
|
||||
});
|
||||
this._loaded = true;
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
|
||||
<ion-nav [initial]="initial"></ion-nav>
|
||||
Reference in New Issue
Block a user