本文整理汇总了TypeScript中ionic-angular.ActionSheetController.create方法的典型用法代码示例。如果您正苦于以下问题:TypeScript ActionSheetController.create方法的具体用法?TypeScript ActionSheetController.create怎么用?TypeScript ActionSheetController.create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ionic-angular.ActionSheetController
的用法示例。
在下文中一共展示了ActionSheetController.create方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: abrirActionSheet
abrirActionSheet() {
let actionSheet = this.actionSheetCtrl.create(
{
title: 'Opções',
buttons: [
{
icon: 'md-create',
text: 'Opcão A',
role: 'destructive',
handler: () => {
}
},
{
text: 'Opcão B',
handler: () => {
}
},
{
icon: 'md-exit',
text: 'Cancelar',
role: 'destructive',
handler: () => {
}
}
]
}
);
actionSheet.present();
}
示例2: openContact
openContact(speaker: SpeakerModel) {
let mode = this.config.get('mode');
let actionSheet = this.actionSheetCtrl.create({
title: 'Contact with ' + speaker.name,
buttons: [
{
text: `Email ( ${speaker.email} )`,
icon: mode !== 'ios' ? 'mail' : null,
handler: () => {
window.open('mailto:' + speaker.email);
}
},
{
text: `Call ( ${speaker.phone} )`,
icon: mode !== 'ios' ? 'call' : null,
handler: () => {
window.open('tel:' + speaker.phone);
}
}
]
});
actionSheet.present();
}
示例3: share
share(concert) {
let actionSheet: ActionSheet = this.actionSheetCtrl.create({
title: 'Share via',
buttons: [
{
text: 'Twitter',
handler: () => console.log('share via twitter')
},
{
text: 'Facebook',
handler: () => console.log('share via facebook')
},
{
text: 'Email',
handler: () => console.log('share via email')
},
{
text: 'Cancel',
role: 'cancel',
handler: () => console.log('cancel share')
}
]
});
actionSheet.present();
}
示例4: showAccountSelector
private showAccountSelector() {
let options:any[] = [];
_.forEach(this.accounts, (account: any) => {
options.push(
{
text: (account.givenName || account.familyName) + ' (' + account.email + ')',
handler: () => {
this.onAccountSelect(account);
}
}
);
});
// Cancel
options.push(
{
text: this.translate.instant('Cancel'),
role: 'cancel',
handler: () => {
this.navCtrl.pop();
}
}
);
let actionSheet = this.actionSheetCtrl.create({
title: this.translate.instant('From BitPay account'),
buttons: options
});
actionSheet.present();
}
示例5: openSpeakerShare
openSpeakerShare(speaker: SpeakerModel) {
const actionSheet = this.actionSheetCtrl.create({
title: `Share ${speaker.name}`,
buttons: [
{
text: 'Copy Link',
handler: () => {
console.log(`Copy link clicked on https://twitter.com/${speaker.twitter}`);
if (window['cordova'] && window['cordova'].plugins.clipboard) {
window['cordova'].plugins.clipboard.copy(`https://twitter.com/${speaker.twitter}`);
}
}
},
{
text: 'Share via ...',
handler: () => {
console.log('Share via clicked');
}
},
{
text: 'Cancel',
role: 'cancel',
handler: () => {
console.log('Cancel clicked');
}
}
]
});
actionSheet.present();
}
示例6: showActionSheet
showActionSheet()
{
let actionSheet = this.actionSheetCtrl.create({
title: this.cpInfo.name,
buttons: [{
text: 'Credit Reviews',
handler: ()=>{
let navTransition = actionSheet.dismiss();
//mock data
let documents = [{"docName": "appraisal_sample1.docx", "docUrl": "www/mock/appraisal_sample1.docx"},
{"docName": "appraisal_sample2.pdf", "docUrl": "www/mock/appraisal_sample2.pdf"},
{"docName": "appraisal_sample3.xlsx", "docUrl": "www/mock/appraisal_sample3.xlsx"}];
navTransition.then(()=>{
//open the list of documents for the cp
this.navCtrl.push(CounterpartyCaPage,
{ "counterpartyName": this.cpInfo.name, "documents": documents });
});
return false;
}
},{
text: 'Cancel',
role: 'cancel',
handler: ()=>{
;
}
}]
})
actionSheet.present();
}
示例7: presentActionSheet
presentActionSheet():void {
let actionSheet = this.actionSheetCtrl.create({
title: '',
buttons: [
{
text: 'Get secured content',
role: 'destructive',
handler: () => {
this.users.getSecuredData().subscribe(response => {
console.log(response);
})
}
},
{
text: 'Log out',
handler: () => {
localStorage.setItem('id_token', '');
this.nav.push(LoginPage);
}
},
{
text: 'Cancel',
role: 'cancel',
handler: () => {
console.log('Cancel clicked');
}
}
]
});
actionSheet.present();
}
示例8: connectPolicy
connectPolicy(){
let actionSheet = this.actionSheetCtrl.create({
title: 'Connect Policy Options',
buttons: [
{
text: 'Connect To Last Device',
handler: () => {
console.log('Connect To Last Deviceclicked');
}
},
{
text: 'Connect To List',
handler: () => {
console.log('Connect To List clicked');
}
},
{
text: 'Cancel',
role: 'cancel',
handler: () => {
console.log('Cancel clicked');
}
}
]
});
actionSheet.present();
}
示例9: options
private options(songUrl: string, userUrl: string): void {
let actions = this.actionCtrl.create({
title: "Actions",
buttons: [
{
text: "Visit on SoundCloud",
icon: "link",
handler: () => {
window.open(songUrl);
}
},
{
text: "See who posted",
icon: "person",
handler: () => {
window.open(userUrl);
}
},
{
text: 'Cancel',
role: 'cancel',
icon: "close",
handler: () => {
console.log('Cancel clicked');
}
}
]
});
actions.present();
}
示例10: connectTimeoutOptions
connectTimeoutOptions(){
let actionSheet = this.actionSheetCtrl.create({
title: 'Connect Timeout To Options',
buttons: [
{
text: 'Pairing',
handler: () => {
console.log('Pairing clicked');
}
},
{
text: 'Connectable',
handler: () => {
console.log('Connectable clicked');
}
},
{
text: 'Idle',
handler: () => {
console.log('Idle clicked');
}
},
{
text: 'Cancel',
role: 'cancel',
handler: () => {
console.log('Cancel clicked');
}
}
]
});
actionSheet.present();
}