mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 19:57:22 +08:00
37 lines
729 B
TypeScript
37 lines
729 B
TypeScript
import {App, IonicView, IonicApp, IonicConfig, Platform} from 'ionic/ionic';
|
|
import {Popup} from 'ionic/ionic';
|
|
|
|
|
|
@App({
|
|
templateUrl: 'main.html'
|
|
})
|
|
class MyAppCmp {
|
|
|
|
constructor(popup: Popup, app: IonicApp, ionicConfig: IonicConfig) {
|
|
this.popup = popup;
|
|
|
|
}
|
|
|
|
doAlert() {
|
|
this.popup.alert('What!?').then(() => {
|
|
}, () => {
|
|
});
|
|
}
|
|
|
|
doPrompt() {
|
|
this.popup.prompt('What is your name?').then((name, event) => {
|
|
console.log('Got response', name);
|
|
}, () => {
|
|
console.error('Prompt closed');
|
|
});
|
|
}
|
|
|
|
doConfirm() {
|
|
this.popup.confirm('Are you sure?').then((yes, event) => {
|
|
console.log('CONFIRMED', yes);
|
|
}, () => {
|
|
console.error('NOT CONFIRMED');
|
|
});
|
|
}
|
|
}
|