mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 11:41:20 +08:00
Dialogs plugin
This commit is contained in:
@ -11,6 +11,7 @@ import {ContactsPage} from 'pages/contacts';
|
||||
import {DevicePage} from 'pages/device';
|
||||
import {DeviceMotionPage} from 'pages/device-motion';
|
||||
import {DeviceOrientationPage} from 'pages/device-orientation';
|
||||
import {DialogsPage} from 'pages/dialogs';
|
||||
import {GeolocationPage} from 'pages/geolocation';
|
||||
import {VibrationPage} from 'pages/vibration';
|
||||
|
||||
@ -22,12 +23,13 @@ class MyApp {
|
||||
this.app = app;
|
||||
|
||||
this.firstPage = CameraPage;
|
||||
|
||||
|
||||
this.plugins = [
|
||||
{title: 'Camera', page: CameraPage},
|
||||
{title: 'Device', page: DevicePage},
|
||||
{title: 'Device Motion', page: DeviceMotionPage},
|
||||
{title: 'Device Orientation', page: DeviceOrientationPage},
|
||||
{title: 'Dialogs', page: DialogsPage},
|
||||
{title: 'Geolocation', page: GeolocationPage},
|
||||
{title: 'Contacts', page: ContactsPage},
|
||||
{title: 'Battery', page: BatteryPage},
|
||||
|
34
demos/native/pages/dialogs.ts
Normal file
34
demos/native/pages/dialogs.ts
Normal file
@ -0,0 +1,34 @@
|
||||
import {IonicView, Dialogs} from 'ionic/ionic';
|
||||
|
||||
|
||||
@IonicView({
|
||||
template: `
|
||||
<ion-navbar *navbar>
|
||||
<a menu-toggle>
|
||||
<icon menu></icon>
|
||||
</a>
|
||||
<ion-title>Dialogs</ion-title>
|
||||
</ion-navbar>
|
||||
<ion-content class="padding">
|
||||
<h2>Device</h2>
|
||||
<button primary outline (click)="doAlert()">Do Alert</button>
|
||||
<button primary outline (click)="doConfirm()">Do Confirm</button>
|
||||
<button primary outline (click)="doPrompt()">Do Prompt</button>
|
||||
</ion-content>
|
||||
`
|
||||
})
|
||||
export class DialogsPage {
|
||||
doAlert() {
|
||||
Dialogs.alert('Hello');
|
||||
}
|
||||
doConfirm() {
|
||||
Dialogs.confirm('Do you want to click that?').then((resp) => {
|
||||
console.log(resp);
|
||||
});
|
||||
}
|
||||
doPrompt() {
|
||||
Dialogs.prompt('What is your fav ice cream?').then((resp) => {
|
||||
console.log(resp);
|
||||
});
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user