本文整理匯總了TypeScript中ionic-angular.ActionSheet類的典型用法代碼示例。如果您正苦於以下問題:TypeScript ActionSheet類的具體用法?TypeScript ActionSheet怎麽用?TypeScript ActionSheet使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了ActionSheet類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: 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();
}
示例2: openAS
openAS() {
let actionSheet = ActionSheet.create({
title: 'Goals',
cssClass: 'action-sheets-goals-page',
buttons: [
{
text: 'Delete',
role: 'destructive',
handler: () => {
console.log('Delete clicked');
}
}, {
text: 'Add',
handler: () => {
console.log('Archive clicked');
this.openPage(AddGoalsPage);
}
}, {
text: 'Cancel',
role: 'cancel',
handler: () => {
console.log('Cancel clicked');
}
}
]
});
this.nav.present(actionSheet);
}
示例3: openAppSettings
openAppSettings(app) {
let actionSheet = ActionSheet.create({
title: 'Share ' + app.name,
buttons: [
{
text: 'Copy Link',
handler: () => {
console.log("Copy link clicked on https://twitter.com/" + app.twitter);
if (window['cordova'] && window['cordova'].plugins.clipboard) {
window['cordova'].plugins.clipboard.copy("https://twitter.com/" + app.twitter);
}
}
},
{
text: 'Share via ...',
handler: () => {
console.log("Share via clicked");
}
},
{
text: 'Cancel',
role: 'cancel',
handler: () => {
console.log("Cancel clicked");
}
}
]
});
this.nav.present(actionSheet);
}
示例4: openMenu
openMenu() {
this.actionSheet = ActionSheet.create({
title: 'Activity',
buttons: [
{
text: 'Delete',
role: 'destructive',
icon: 'trash',
handler: () => {
this._activityProvider.removeActivity(
this.activity,
this.expandedActivities[this.expandedActivities.length - 1]
);
}
},
{
text: 'Cancel',
role: 'cancel',
icon: null,
handler: () => {
this.actionSheet && this.actionSheet.dismiss();
}
}
]
});
this.nav.present(this.actionSheet);
}
示例5: presentActionSheet
presentActionSheet() {
let actionSheet = ActionSheet.create({
buttons: [
{
text: 'Choose Photo',
handler: () => {
this.getPicture(0); // 1 == Library
}
},
{
text: 'Take Photo',
handler: () => {
this.getPicture(1); // 1 == Camera
}
},
{
text: 'Demo Photo',
handler: () => {
this.srcImage = 'demo.png';
}
},
{
text: 'Cancel',
role: 'cancel'
}
]
});
this.nav.present(actionSheet);
}
示例6: openMenu
openMenu() {
let actionSheet = ActionSheet.create({
title: 'Albums',
cssClass: 'action-sheets-basic-page',
buttons: [
{
text: 'Tulis Artikel',
role: 'destructive',
icon: !this.platform.is('ios') ? 'book' : null,
handler: () => {
console.log('Delete clicked');
this.nav.push(TulisArtikelPage);
}
},
{
text: 'Tanya / Diskusi',
icon: !this.platform.is('ios') ? 'people' : null,
handler: () => {
console.log('Share clicked');
this.nav.push(TulisDiskusiPage);
}
},
{
text: 'Batal',
role: 'cancel', // will always sort to be on the bottom
icon: !this.platform.is('ios') ? 'close' : null,
handler: () => {
console.log('Cancel clicked');
}
}
]
});
this.nav.present(actionSheet);
}
示例7: openFilters
openFilters(){
let sheet = ActionSheet.create({
title: 'Filter by ...',
buttons: [
{
text: 'Movies only',
handler: () => {
this.results = this._unfilteredResults.filter( (item) => item.kind === 'feature-movie' )
this.usesFilter = true
}
},
{
text: 'Songs only',
handler: () => {
this.results = this._unfilteredResults.filter( (item) => item.kind === 'song' )
this.usesFilter = true
}
},
{
text: 'Clear',
style: 'destructive',
handler: () => {
this.results = this._unfilteredResults
this.usesFilter = false
}
},
{
text: 'Canel',
style: 'cancel'
}
]
})
this.nav.present(sheet)
}
示例8: openMenu
openMenu() {
let actionSheet = ActionSheet.create({
title: 'Albums',
cssClass: 'action-sheets-basic-page',
buttons: [
{
text: 'Options',
icon: !this.platform.is('ios') ? 'share' : null,
handler: () => {
}
},
{
text: 'Color',
icon: !this.platform.is('ios') ? 'arrow-dropright-circle' : null,
handler: () => {
}
},
{
text: 'Cancel',
role: 'cancel', // will always sort to be on the bottom
icon: !this.platform.is('ios') ? 'close' : null,
handler: () => {
}
}
]
});
this.navCtrl.present(actionSheet);
}
示例9: openMenu
openMenu(course) {
let actionSheet = ActionSheet.create({
title: 'Options',
cssClass: 'action-sheets-basic-page',
buttons: [
{
text: 'Enroll',
icon: !this.platform.is('ios') ? 'add' : null,
handler: () => {
this.enrollCourse(course);
}
},
{
text: 'View',
icon: !this.platform.is('ios') ? 'eye' : null,
handler: () => {
this.viewCourse(course);
}
},
{
text: 'Cancel',
role: 'cancel', // will always sort to be on the bottom
icon: !this.platform.is('ios') ? 'close' : null,
handler: () => {
}
}
]
});
this.nav.present(actionSheet);
}
示例10: showOptions
showOptions(){
let action = ActionSheet.create({
title: 'Options post',
buttons: [
{
text: 'Destructive',
role: 'destructive',
handler: () => {
console.log('Destructive clicked');
}
},
{
text: 'Archive',
handler: () => {
console.log('Archive clicked');
}
},
{
text: 'Cancel',
role: 'cancel',
handler: () => {
console.log('Cancel clicked');
}
}
]
});
this.navCtrl.present( action );
}