furf / jquery-ui-touch-punch

A duck punch for adding touch events to jQuery UI
http://touchpunch.furf.com/
3.51k stars 1.34k forks source link

How to Import jQuery Ui Touch Punch in Angular #289

Open hsuanweifu opened 7 years ago

hsuanweifu commented 7 years ago

How do you import jquery ui in angular?

I have tried the following.

 "jquery": "^3.2.1",
 "jquery-ui": "^1.12.1",
 "jquery-ui-touch-punch": "^0.2.3",
import * as $ from "jquery";
import 'jquery-ui/ui/core';
import 'jquery-ui/ui/widget';
import 'jquery-ui/ui/widgets/mouse';
import 'jquery-ui/ui/widgets/draggable';
import 'jquery-ui/ui/widgets/selectable';
import 'jquery-ui-touch-punch';

Uncaught (in promise): ReferenceError: jQuery is not defined ReferenceError:

Thanks.

martijnwip commented 7 years ago

I get a different error : Property 'draggable' does not exist on type 'JQuery'.

pratikgavas commented 6 years ago

Any solution for this?

Hey, I found one workaround. You can copy all the code of jquery-ui-touch-punch.js which is inside jQuery Function and paste it into constructor of ts file where you import jQuery. So you can access to draggable and droppable event. Hope so it will help. Thank you. :)