import {Component} from 'angular2/src/core/annotations_impl/annotations'; import {View} from 'angular2/src/core/annotations_impl/view'; import {Tabs, Tab, NavController, NavbarTemplate, Navbar, Content} from 'ionic/ionic'; @Component({ selector: 'ion-tabs-view' }) @View({ templateUrl: './pages/tabs.html', directives: [Tabs, Tab, Content, NavbarTemplate, Navbar] }) export class TabsPage { constructor(nav: NavController) { this.tab1Initial = Tab1Page1 //this.tab2Initial = Tab2Page1 } } // // tab 1 // @Component({selector: 'ion-view'}) @View({ template: '' + '' + 'Tabs 1 Page 1' + '' + '' + '

' + '' + '' + '
', directives: [NavbarTemplate, Navbar, Content] }) export class Tab1Page1 { constructor(nav: NavController) { this.nav = nav; console.log('Tab1Page1 onInit') } push() { this.nav.push(Tab1Page2) } } @Component({selector: 'ion-view'}) @View({ template: '' + '' + 'Tabs 1 Page 2' + '' + '' + '

' + '' + '' + '
', directives: [NavbarTemplate, Navbar, Content] }) export class Tab1Page2 { constructor(nav: NavController) { this.nav = nav; } pop() { this.nav.push() } } // // tab 2 // @Component({ selector: 't2p1' }) @View({ template: `

Tab 2 Page 1.


I have got an aside on the left.
`, directives: [Content] }) class Tab2Page1 { // TODO change to 'Nav' injection when we're allowed to inject a tab as a nav. constructor(nav: NavController) { this.nav = nav } next() { this.nav.push(Tab2Page2) } } @Component({ selector: 't2p2' }) @View({ template: ` Nested Tab 1, static content Nested Tab 2, static content `, directives: [Tabs, Tab, Content] }) class Tab2Page2 { // TODO change to 'Nav' injection when we're allowed to inject a tab as a nav. constructor(nav: NavController) { this.nav = nav } pop() { this.nav.pop() } }