ionic-framework
Version:
73 lines • 2.95 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 E2EApp = (function () {
function E2EApp(popup) {
this.popup = popup;
this.alertOpen = false;
this.promptOpen = false;
this.promptResult = '';
this.confirmOpen = false;
this.confirmResult = '';
}
E2EApp.prototype.doAlert = function () {
var _this = this;
this.alertOpen = true;
this.popup.alert({
title: "New Friend!",
template: "Your friend, Obi wan Kenobi, just accepted your friend request!",
cssClass: 'my-alert'
}).then(function () {
_this.alertOpen = false;
});
};
E2EApp.prototype.doPrompt = function () {
var _this = this;
this.promptOpen = true;
this.popup.prompt({
title: "New Album",
template: "Enter a name for this new album you're so keen on adding",
inputPlaceholder: "Title",
okText: "Save"
}).then(function (name) {
_this.promptResult = name;
_this.promptOpen = false;
}, function () {
console.log('Prompt closed');
_this.promptOpen = false;
});
};
E2EApp.prototype.doConfirm = function () {
var _this = this;
this.confirmOpen = true;
this.popup.confirm({
title: "Use this lightsaber?",
subTitle: "You can't exchange lightsabers",
template: "Do you agree to use this lightsaber to do good across the intergalactic galaxy?",
cancelText: "Disagree",
okText: "Agree"
}).then(function (result, ev) {
console.log('CONFIRMED', result);
_this.confirmResult = result;
_this.confirmOpen = false;
}, function () {
_this.confirmOpen = false;
console.log('NOT CONFIRMED');
});
};
E2EApp = __decorate([
ionic_1.App({
templateUrl: 'main.html'
}),
__metadata('design:paramtypes', [(typeof (_a = typeof ionic_1.Popup !== 'undefined' && ionic_1.Popup) === 'function' && _a) || Object])
], E2EApp);
return E2EApp;
var _a;
})();