import {App, Page, NavController, Tab} from 'ionic/ionic';
import {ContentChild, QueryList, ViewChildren} from 'angular2/core';
//
// Tab 1
//
@Page({
template: `
Heart
Tab 1
`
})
class Tab1 {
constructor(nav: NavController) {
this.nav = nav;
}
}
//
// Tab 2
//
@Page({
template: `
Star
Tab 2
`
})
class Tab2 {
constructor(nav: NavController) {
this.nav = nav;
}
}
//
// Tab 3
//
@Page({
template: `
Stopwatch
Tab 3
`
})
class Tab3 {
constructor(nav: NavController) {
this.nav = nav;
}
}
//
// Tab 3
//
@Page({
template: `
Quesarito
Quesarito
`
})
class QuesaritoPage {
constructor(nav: NavController) {
this.nav = nav;
}
}
@App({
template: `
Secret Menu
`
})
export class TabsPage {
@ViewChildren(Tab) tab : QueryList;
ngAfterViewInit() {
console.log('Tab', this.tab);
console.log(this.tab.first.setRoot);
}
openPage(which) {
let pages = {
'quesarito': QuesaritoPage
};
this.tab.first.setRoot(pages[which])
}
constructor() {
this.root1 = Tab1;
this.root2 = Tab2;
this.root3 = Tab3;
}
ngOnInit() {
}
}