Support for hammer.js touch events in an Angular component's template

ABSTRACT
A project is based on Angular 8.
Hammer.js has been added in order to support touch gestures.

ISSUE

IDE doesn't seem to recognize events provided by hammer.js (for example, "swiperight", "swipeleft") and provides only two options:
* rearrange tag attributes (doesn't work)
* remove an event helper (not applicable)

PyCharm complains with a following error: "Event swipeleft is not emitted by any applicable directives nor by div element".

NOTES

I thought it could be easily fixed by declaring a list of supported events in a HammerGestureConfig (events section) but that didn't work (tried invalidating cache and restart afterward).

3
4 comments

Please vote for https://youtrack.jetbrains.com/issue/WEB-43773 to be notified on any progress with it

0
Avatar
Permanently deleted user

Got it.
Elena Pogorelova, could you, please, provide a workaround for now that disables that check?
Thanks.

0

you can suppress it with a comment, like

 

<!--suppress AngularUndefinedBinding -->
<div class="gesture__zone" (swipe)="onSwipe($event)">
0
Avatar
Permanently deleted user

Got it, thanks.

0

Please sign in to leave a comment.