本文整理汇总了TypeScript中ionic-angular/gestures/gesture.Gesture.on方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Gesture.on方法的具体用法?TypeScript Gesture.on怎么用?TypeScript Gesture.on使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ionic-angular/gestures/gesture.Gesture
的用法示例。
在下文中一共展示了Gesture.on方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: ngOnInit
ngOnInit() {
this.swipeGesture = new Gesture(this.el, {
recognizers: [
[Hammer.Swipe, {direction: Hammer.DIRECTION_VERTICAL}]
]
});
this.swipeGesture.listen()
this.swipeGesture.on('swipeup', e => {
this.actionUp()
})
this.swipeGesture.on('swipedown', e => {
this.actionDown()
})
}
示例2: ngOnInit
ngOnInit() {
this.pressGesture = new Gesture(this.el);
this.pressGesture.listen();
this.pressGesture.on('press', e => {
let actionSheet = ActionSheet.create({
title: 'Modify your album',
buttons: [
{
text: 'Delete',
role: 'destructive',
icon: 'trash',
handler: () => {
// console.log(this.el.textContent.trim());
console.log(this.obj);
console.log(Games.find({ _id: this.obj }).fetch());
// console.log(Lists.find({ _id: this.obj }).length>0);
if (Games.find({ _id: this.obj }).fetch().length > 0)
console.log(Games.remove({ _id: this.obj }));
// else if (ShoppingLists.find({ _id: this.obj }).fetch().length > 0)
// console.log(ShoppingLists.remove({ _id: this.obj }));
}
}, {
text: 'Cancel',
role: 'cancel',
cssClass: 'redd',
handler: () => {
console.log('Cancel clicked');
}
}
],
});
this.nav.present(actionSheet);
})
}
示例3: ngOnInit
ngOnInit() {
this.swipeGesture = new Gesture(this.el, {
recognizers: [
[Hammer.Swipe, {direction: Hammer.DIRECTION_VERTICAL}]
]
});
this.swipeGesture.listen();
this.swipeGesture.on('swipeup', e => {
console.log('swipeup!!');
this.events.publish('event:swipe','up');
})
this.swipeGesture.on('swipedown', e => {
console.log('swipedown!!');
this.events.publish('event:swipe','down');
})
}