cedvdb / ng2draggable

draggable directive for angular 2
https://cedvdb.github.io/ng2draggable/
MIT License
18 stars 16 forks source link

ReferenceError: TouchEvent is not defined #22

Open lrabuffetti opened 6 years ago

lrabuffetti commented 6 years ago

I get this error when I add the directive.

ReferenceError: TouchEvent is not defined

image

yuriy-nyllabs commented 6 years ago

I ran into this problem with Safari. I ended up copying the ng2-draggable.directive.ts file over to my source code and imported it as a regular directive. Every line that had event:TouchEvent, I changed to event: TouchEvent | any.

This has worked for me.

Edit: This might not work for you since the Safari error was something like unknown variable TouchEvent