cormacrelf / dragula-touch-demo

13 stars 5 forks source link

dragula_1.default is not a function #1

Closed sga-lalitesh closed 7 years ago

sga-lalitesh commented 7 years ago

I'm facing this issue in my angular4 application. Import section import {DragulaService} from 'ng2-dragula/ng2-dragula'; import dragula from 'dragula'; import autoScroll from 'dom-autoscroller';

`ngOnInit() { // create the drake manually so we can refer to it's dragging property let drake = dragula(); this.dragulaService.add('STOP_BAG', drake);

    this.scroll = autoScroll(
      window,
      {
        margin: 30,
        maxSpeed: 25,
        scrollWhenOutside: true,

        autoScroll: function () {
          return this.down && drake.dragging;
        }
      });
  }`
cormacrelf commented 7 years ago

Install dragula please.

sga-lalitesh commented 7 years ago

Dragula is installed in my repo. I can see the dragula.js in node_modules. But still the error is there....

cormacrelf commented 7 years ago

This repo worked when I built it. Fix it yourself. Sorry.

On 29 Aug 2017, at 3:43 pm, Lalitesh Upadhyaya notifications@github.com wrote:

Dragula is installed in my repo. I can see the dragula.js in node_modules. But still the error is there....

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

KEMBL commented 4 years ago

try to import dragula and autoScroll like that:

import * as dragula from 'dragula';

import * as autoScroll from 'dom-autoscroller';

also applicable for #5