UNPKG

ionic-framework

Version:
107 lines 4.87 kB
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; var ionic_1 = require('ionic/ionic'); var core_1 = require('angular2/core'); // // Tab 1 // var Tab1 = (function () { function Tab1(nav) { this.nav = nav; } Tab1 = __decorate([ ionic_1.Page({ template: "\n <ion-navbar *navbar>\n <ion-title>Heart</ion-title>\n </ion-navbar>\n <ion-content padding>\n <h2>Tab 1</h2>\n </ion-content>\n " }), __metadata('design:paramtypes', [(typeof (_a = typeof ionic_1.NavController !== 'undefined' && ionic_1.NavController) === 'function' && _a) || Object]) ], Tab1); return Tab1; var _a; })(); // // Tab 2 // var Tab2 = (function () { function Tab2(nav) { this.nav = nav; } Tab2 = __decorate([ ionic_1.Page({ template: "\n <ion-navbar *navbar>\n <ion-title>Star</ion-title>\n </ion-navbar>\n <ion-content padding>\n <h2>Tab 2</h2>\n </ion-content>\n " }), __metadata('design:paramtypes', [(typeof (_a = typeof ionic_1.NavController !== 'undefined' && ionic_1.NavController) === 'function' && _a) || Object]) ], Tab2); return Tab2; var _a; })(); // // Tab 3 // var Tab3 = (function () { function Tab3(nav) { this.nav = nav; } Tab3 = __decorate([ ionic_1.Page({ template: "\n <ion-navbar *navbar>\n <button menu-toggle>\n <icon menu></icon>\n </button>\n <ion-title>Stopwatch</ion-title>\n </ion-navbar>\n <ion-content padding>\n <h2>Tab 3</h2>\n </ion-content>\n " }), __metadata('design:paramtypes', [(typeof (_a = typeof ionic_1.NavController !== 'undefined' && ionic_1.NavController) === 'function' && _a) || Object]) ], Tab3); return Tab3; var _a; })(); // // Tab 3 // var QuesaritoPage = (function () { function QuesaritoPage(nav) { this.nav = nav; } QuesaritoPage = __decorate([ ionic_1.Page({ template: "\n <ion-navbar *navbar>\n <button menu-toggle>\n <icon menu></icon>\n </button>\n <ion-title>Quesarito</ion-title>\n </ion-navbar>\n <ion-content padding>\n <h2>Quesarito</h2>\n </ion-content>\n " }), __metadata('design:paramtypes', [(typeof (_a = typeof ionic_1.NavController !== 'undefined' && ionic_1.NavController) === 'function' && _a) || Object]) ], QuesaritoPage); return QuesaritoPage; var _a; })(); var TabsPage = (function () { function TabsPage() { this.root1 = Tab1; this.root2 = Tab2; this.root3 = Tab3; } TabsPage.prototype.ngAfterViewInit = function () { console.log('Tab', this.tab); console.log(this.tab.first.setRoot); }; TabsPage.prototype.openPage = function (which) { var pages = { 'quesarito': QuesaritoPage }; this.tab.first.setRoot(pages[which]); }; TabsPage.prototype.ngOnInit = function () { }; __decorate([ core_1.ViewChildren(ionic_1.Tab), __metadata('design:type', (typeof (_a = typeof core_1.QueryList !== 'undefined' && core_1.QueryList) === 'function' && _a) || Object) ], TabsPage.prototype, "tab", void 0); TabsPage = __decorate([ ionic_1.App({ template: "\n <ion-menu [content]=\"content\">\n <ion-toolbar secondary>\n <ion-title>Secret Menu</ion-title>\n </ion-toolbar>\n <ion-content>\n <ion-list>\n <button ion-item menu-close detail-none (click)=\"openPage('quesarito')\">\n Quesarito\n </button>\n </ion-list>\n </ion-content>\n </ion-menu>\n\n <ion-tabs #content>\n <ion-tab tab-title=\"Heart\" tab-icon=\"heart\" [root]=\"root1\" #tab1></ion-tab>\n <ion-tab tab-title=\"Star\" tab-icon=\"star\" [root]=\"root2\"></ion-tab>\n <ion-tab tab-title=\"Stopwatch\" tab-icon=\"stopwatch\" [root]=\"root3\"></ion-tab>\n </ion-tabs>\n " }), __metadata('design:paramtypes', []) ], TabsPage); return TabsPage; var _a; })(); exports.TabsPage = TabsPage;