docs(alert)

This commit is contained in:
mhartington
2016-01-05 16:06:40 -05:00
parent 94f1e0964e
commit 03e13b5505
2 changed files with 55 additions and 22 deletions

View File

@ -4,8 +4,8 @@ import {forwardRef} from 'angular2/core';
@Page({
templateUrl: 'alerts/basic/template.html',
directives: [forwardRef(() => AndroidAttribute)]
templateUrl: 'alerts/basic/template.html',
directives: [forwardRef(() => AndroidAttribute)]
})
export class BasicPage {
@ -15,30 +15,63 @@ export class BasicPage {
doAlert() {
let alert = Alert.create({
title: "New Friend!",
subTitle: "Your friend, Obi wan Kenobi, just accepted your friend request!",
title: 'New Friend!',
subTitle: 'Your friend, Obi wan Kenobi, just accepted your friend request!',
buttons: ['Ok']
});
this.nav.present(alert);
}
// doPrompt() {
// this.popup.prompt({
// title: "New Album",
// template: "Enter a name for this new album you're so keen on adding",
// inputPlaceholder: "Title",
// okText: "Save"
// });
// }
doPrompt() {
Baasbox Javascript SDK
let prompt = Alert.create({
title: 'Login',
body: "Enter a name for this new album you're so keen on adding",
inputs: [
{
name: 'title',
placeholder: 'Title'
},
],
buttons: [
{
text: 'Cancel',
handler: data => {
console.log('Cancel clicked');
}
},
{
text: 'Save',
handler: data => {
console.log('Saved clicked');
}
}
]
});
this.nav.present(prompt);
}
// doConfirm() {
// this.popup.confirm({
// title: "Use this lightsaber?",
// template: "Do you agree to use this lightsaber to do good across the intergalactic galaxy?",
// cancelText: "Disagree",
// okText: "Agree"
// });
// }
doConfirm() {
let confirm = Alert.create({
title: 'Use this lightsaber?',
body: 'Do you agree to use this lightsaber to do good across the intergalactic galaxy?',
buttons: [
{
text: 'Disagree',
handler: () => {
console.log('Disagree clicked');
}
},
{
text: 'Agree',
handler: () => {
console.log('Agree clicked');
}
}
]
});
this.nav.present(confirm);
}
// onPageWillLeave() {
// let popup = this.popup.get();

View File

@ -5,6 +5,6 @@
<ion-content padding>
<button dark (click)="doAlert()">Alert</button>
<!-- <button light (click)="doPrompt()">Prompt</button>
<button primary (click)="doConfirm()">Confirm</button> -->
<button light (click)="doPrompt()">Prompt</button>
<button primary (click)="doConfirm()">Confirm</button>
</ion-content>