I'm trying to launch pinch gestures without launch rotate gestures also. My purpose is launch both gestures separately.
I have built hammer configuration in my module, as below:
import * as Hammer from 'hammerjs';
import { HammerGestureConfig } from '@angular/platform-browser';
export class HammerConfig extends HammerGestureConfig{
buildHammer(element: HTMLElement)
{
const hammerManager = new Hammer(element);
let rotate = new Hammer.Rotate({enable: true});
let pinch = new Hammer.Pinch({enable: true});
let pan = new Hammer.Pan();
pan.requireFailure([rotate, pinch]);
pinch.recognizeWith(rotate);
hammerManager.add([rotate, pan, pinch]);
return hammerManager;
}
}
I am trying with:
pinch.dropRecognizeWith(rotate);
and
rotate.dropRecognizeWith(pinch);
This changes doesn't work. Only rotate gestures are launched...
If I add:
pinch.recognizeWith(rotate);
It launches both events...
Are there any way to launch them separately? I will appreciate any kind of help
hammer.js
?