Skip to content
This repository was archived by the owner on Aug 15, 2023. It is now read-only.

using swipe event with directions #147

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions src/pages/gestures/basic/pages.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component } from '@angular/core';

import { Gesture } from 'ionic-angular';

@Component({
templateUrl: 'template.html'
Expand All @@ -16,12 +16,23 @@ export class BasicPage {
pressEvent(e) {
this.press++
}

panEvent(e) {
this.pan++
}
swipeEvent(e) {
this.swipe++

swipeEvent(gesture: Gesture) {
const direction:number = Number(gesture.direction);
// swipe right
if(direction === 2){
this.swipe++;
}
// swipe left
if(direction === 4){
this.swipe--;
}
}

tapEvent(e) {
this.tap++
}
Expand Down