mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-21 21:15:24 +08:00
docs(alert)
This commit is contained in:
@ -4,8 +4,8 @@ import {forwardRef} from 'angular2/core';
|
|||||||
|
|
||||||
|
|
||||||
@Page({
|
@Page({
|
||||||
templateUrl: 'alerts/basic/template.html',
|
templateUrl: 'alerts/basic/template.html',
|
||||||
directives: [forwardRef(() => AndroidAttribute)]
|
directives: [forwardRef(() => AndroidAttribute)]
|
||||||
})
|
})
|
||||||
export class BasicPage {
|
export class BasicPage {
|
||||||
|
|
||||||
@ -15,30 +15,63 @@ export class BasicPage {
|
|||||||
|
|
||||||
doAlert() {
|
doAlert() {
|
||||||
let alert = Alert.create({
|
let alert = Alert.create({
|
||||||
title: "New Friend!",
|
title: 'New Friend!',
|
||||||
subTitle: "Your friend, Obi wan Kenobi, just accepted your friend request!",
|
subTitle: 'Your friend, Obi wan Kenobi, just accepted your friend request!',
|
||||||
buttons: ['Ok']
|
buttons: ['Ok']
|
||||||
});
|
});
|
||||||
this.nav.present(alert);
|
this.nav.present(alert);
|
||||||
}
|
}
|
||||||
|
|
||||||
// doPrompt() {
|
doPrompt() {
|
||||||
// this.popup.prompt({
|
Baasbox Javascript SDK
|
||||||
// title: "New Album",
|
let prompt = Alert.create({
|
||||||
// template: "Enter a name for this new album you're so keen on adding",
|
title: 'Login',
|
||||||
// inputPlaceholder: "Title",
|
body: "Enter a name for this new album you're so keen on adding",
|
||||||
// okText: "Save"
|
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() {
|
doConfirm() {
|
||||||
// this.popup.confirm({
|
let confirm = Alert.create({
|
||||||
// title: "Use this lightsaber?",
|
title: 'Use this lightsaber?',
|
||||||
// template: "Do you agree to use this lightsaber to do good across the intergalactic galaxy?",
|
body: 'Do you agree to use this lightsaber to do good across the intergalactic galaxy?',
|
||||||
// cancelText: "Disagree",
|
buttons: [
|
||||||
// okText: "Agree"
|
{
|
||||||
// });
|
text: 'Disagree',
|
||||||
// }
|
handler: () => {
|
||||||
|
console.log('Disagree clicked');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: 'Agree',
|
||||||
|
handler: () => {
|
||||||
|
console.log('Agree clicked');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
this.nav.present(confirm);
|
||||||
|
}
|
||||||
|
|
||||||
// onPageWillLeave() {
|
// onPageWillLeave() {
|
||||||
// let popup = this.popup.get();
|
// let popup = this.popup.get();
|
||||||
|
@ -5,6 +5,6 @@
|
|||||||
|
|
||||||
<ion-content padding>
|
<ion-content padding>
|
||||||
<button dark (click)="doAlert()">Alert</button>
|
<button dark (click)="doAlert()">Alert</button>
|
||||||
<!-- <button light (click)="doPrompt()">Prompt</button>
|
<button light (click)="doPrompt()">Prompt</button>
|
||||||
<button primary (click)="doConfirm()">Confirm</button> -->
|
<button primary (click)="doConfirm()">Confirm</button>
|
||||||
</ion-content>
|
</ion-content>
|
||||||
|
Reference in New Issue
Block a user