typescript - How can I change gesture event options dynamically in Ionic 2? -


i'm starting first project typescript ionic 2 , today events showed in docs (ionic uses hammerjs recognize gestures). example, can use following angular 2 template syntax target swipe event:

<ion-card (swipe)="swipeevent($event)">triggers on swipe</ion-card> 

however, have no idea how access hammerjs instance change event options. thought skipping ionic's implementation of hammer , using hammer outside typescript definitions i'm having problems importing these definitions , don't know how make them work angular.

how can change conditions need met event fire?

for example, event fire when x amount of pointers used, swipe direction x , velocity exceeds value, seen in hammerjs docs. since repeat pattern other event types (pinch, pan, tap, rotate, ...), suppose easier if code directly in view's class rather in template syntax.

also, want able change these options dynamically according json data.

say have 2 possible sets of options in json data, , b:

            |    |  b  | |-----------|------|-----| |  pointers |   2  |  1  | | direction | left |  | |  velocity |  0.3 | 0.5 | 

how can make swipe event listener options change b dynamically? need remove hammer options , reattach options b?


Comments

Popular posts from this blog

html - Styling progress bar with inline style -

java - Oracle Sql developer error: could not install some modules -

How to use autoclose brackets in Jupyter notebook? -