Dialogs plugin

This commit is contained in:
Max Lynch
2015-09-14 14:21:53 -05:00
parent fe028627b8
commit 7c005f2759
5 changed files with 131 additions and 1 deletions

View File

@ -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},

View 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);
});
}
}