ionic-framework
Version:
85 lines • 3.28 kB
JavaScript
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 Page1 = (function () {
function Page1(popup) {
this.popup = popup;
}
Page1.prototype.openPopup = function () {
this.popup.alert({
title: "New Friend!",
template: "Your friend, Obi wan Kenobi, just accepted your friend request!",
cssClass: 'my-alert'
});
console.log('openPopup');
};
Page1 = __decorate([
ionic_1.Page({ templateUrl: 'page1.html' }),
__metadata('design:paramtypes', [(typeof (_a = typeof ionic_1.Popup !== 'undefined' && ionic_1.Popup) === 'function' && _a) || Object])
], Page1);
return Page1;
var _a;
})();
var Page3 = (function () {
function Page3() {
}
Page3 = __decorate([
ionic_1.Page({ templateUrl: 'page3.html' }),
__metadata('design:paramtypes', [])
], Page3);
return Page3;
})();
var Page2 = (function () {
function Page2(nav) {
this.nav = nav;
}
Page2.prototype.page3 = function () {
this.nav.push(Page3);
};
Page2 = __decorate([
ionic_1.Page({ templateUrl: 'page2.html' }),
__metadata('design:paramtypes', [(typeof (_a = typeof ionic_1.NavController !== 'undefined' && ionic_1.NavController) === 'function' && _a) || Object])
], Page2);
return Page2;
var _a;
})();
var E2EApp = (function () {
function E2EApp(app) {
this.app = app;
this.rootView = Page1;
this.pages = [
{ title: 'Page 1', component: Page1 },
{ title: 'Page 2', component: Page2 },
{ title: 'Page 3', component: Page3 },
];
}
E2EApp.prototype.openPage = function (page) {
var _this = this;
// Reset the content nav to have just this page
// we wouldn't want the back button to show in this scenario
var nav = this.app.getComponent('nav');
nav.setRoot(page.component).then(function () {
// wait for the root page to be completely loaded
// then close the menu
_this.app.getComponent('leftMenu').close();
});
};
E2EApp.prototype.onMenuOpening = function (ev) {
console.log('onMenuOpening', ev);
};
E2EApp = __decorate([
ionic_1.App({
templateUrl: 'main.html'
}),
__metadata('design:paramtypes', [(typeof (_a = typeof ionic_1.IonicApp !== 'undefined' && ionic_1.IonicApp) === 'function' && _a) || Object])
], E2EApp);
return E2EApp;
var _a;
})();