Pinch Gesture is not working

hi guys,
its working code of ionic3 and angular 4,

import { Component, ViewChild,ElementRef } from ‘@angular/core’;
import { Gesture } from ‘ionic-angular’;

export class Toto {
constructor(private el:ElementRef){

}

private gesture: Gesture;
@ViewChild('image') ElementRef ;

...

ionViewDidLoad() {
//create gesture obj w/ ref to DOM element
this.gesture = new Gesture(this. el.nativeElement);

//listen for the gesture
this.gesture.listen();

//turn on listening for pinch or rotate events
this.gesture.on('pinch', e => this.pinchEvent(e));
}

private pinchEvent(event) {
    console.log(event);
}

...

}

let cheers

1 Like