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({
|
||||
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();
|
||||
|
@ -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>
|
||||
|
Reference in New Issue
Block a user