本文整理汇总了TypeScript中ionic-angular.ActionSheetController类的典型用法代码示例。如果您正苦于以下问题:TypeScript ActionSheetController类的具体用法?TypeScript ActionSheetController怎么用?TypeScript ActionSheetController使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ActionSheetController类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: startNewGame
startNewGame() {
if(!this.setupData.playerOne || this.setupData.playerOne === "" || !this.setupData.playerTwo || this.setupData.playerTwo === "") {
let actionsheet = this.actionsheet.create({
title: 'You didn\'t specify both player\'s usernames. Their names will be \'Player One\' and \'Player Two\'. Is that okay?',
cssClass: 'setup-actionsheet',
buttons: [
{
text: 'No, I\'ll specify their names.',
icon: 'md-alert',
role: 'cancel'
},
{
text: 'Yes, that\'s fine.',
icon: 'md-checkmark-circle',
role: 'destructive',
handler: () => {
this.setupData.playerOne = "Player One";
this.setupData.playerTwo = "Player Two";
this.newGame(this.setupData);
}
}
]
});
actionsheet.present();
} else {
this.newGame(this.setupData);
}
}
示例2: 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();
}
示例3: 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();
}
示例4: 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();
}
示例5: 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();
}
示例6: 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();
}
示例7: 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();
}
示例8: 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();
}
示例9: 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();
}
示例10: 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();
}