reppners / ngx-drag-drop

Angular directives using the native HTML Drag And Drop API
https://reppners.github.io/ngx-drag-drop/
BSD 3-Clause "New" or "Revised" License
299 stars 118 forks source link

Cannot find name 'DndDropEvent'. #58

Closed netdjw closed 5 years ago

netdjw commented 5 years ago

I just copied the example code into my component and at this code:

  onDrop(event: DndDropEvent) {
    console.log('dropped', JSON.stringify(event, null, 2));
  }

I get this error:

error TS2304: Cannot find name 'DndDropEvent'.

reppners commented 5 years ago

Have you added the import for the type?

import { DndDropEvent } from 'ngx-drag-drop';

netdjw commented 5 years ago

Yes. Of course.

reppners commented 5 years ago

Must be an issue with your project setup, I can't reproduce this wether in stackblitz nor in a local project. If you are able to share your project setup (tsconfig.json, package.json) that might help figure out what the issue is.

netdjw commented 5 years ago

Ach, I missed the import:

import { DndDropEvent } from 'ngx-drag-drop';

Sorry for wasting your time.