kutlugsahin / ngx-smooth-dnd

angular wrapper for smooth-dnd
165 stars 30 forks source link

Cannot read property "reactDropHandler" of undefined #9

Closed GreenMonkeyBoy closed 6 years ago

GreenMonkeyBoy commented 6 years ago

Versions

* @angular/core: 6.0.3
* ngx-smooth-dnd: 0.2.0

Issue

Hello, it's not described in the doc, but I suppose I have to import the NgxSmootDnDModule like in the demo app. But importing this module causes an error.

Repro steps

Stackblitz: https://stackblitz.com/edit/angular-gitter-6kntcb?file=app/app.module.ts

or

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { NgxSmoothDnDModule } from 'ngx-smooth-dnd';

import { AppComponent } from './app.component';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    NgxSmoothDnDModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

Observed behavior

The console display this error message and the app does not work:

ngx-smooth-dnd.js:26 Uncaught TypeError: Cannot read property 'reactDropHandler' of undefined at Object../node_modules/ngx-smooth-dnd/esm5/ngx-smooth-dnd.js (ngx-smooth-dnd.js:26)

kutlugsahin commented 6 years ago

Thanks for submitting the issue. It was an issue about smooth-dnd module bundling. fixed in the v 0.5.4 npm i smooth-dnd@0.5.4 will probably fix the issue. Please let me know if the problem fixed

GreenMonkeyBoy commented 6 years ago

Yes it works upgrading smooth-dnd. Problem fixed, thank you.