getcode
是我想从用户那里获取并传递getCoupon
函数的值然后我想将结果传递给另一个警报并在message属性中显示优惠券而不获取{ {1}}
[object object]
答案 0 :(得分:-2)
实施步骤
在控制器中
`@ angular / core'中的import {Component};
从'ionic-angular'导入{NavController,NavParams};
从'@ ionic-native / action-sheet'导入{ActionSheet,ActionSheetOptions};
let buttonLabelsToShow = ['通过Facebook分享','通过推特分享'];
@零件({
选择器:'page-action-sheet-demo',
templateUrl:'action-sheet-demo.html',
})
导出类ActionSheetDemoPage {
/ **行动表选项* /
选项:ActionSheetOptions = {
标题:'与世界分享这个形象',
副标题:'从各种选项中选择',
buttonLabels:buttonLabelsToShow,
addCancelButtonWithLabel:'取消',
addDestructiveButtonWithLabel:'删除',
destructiveButtonLast:true
}
constructor(private actionSheet: ActionSheet, public navCtrl: NavController, public navParams: NavParams) {
}
ionViewDidLoad() {
console.log('ionViewDidLoad ActionSheetDemoPage');
}
openActionSheet() {
this.actionSheet.show(this.options).then((buttonClickedIndex: number) => {
console.log('Button pressed is' + buttonClickedIndex)
}).catch((err) => {
console.log(err)
});
}
}`
3.在模板<button ion-button (click)="openActionSheet()">Button</button>