fisshy/angular-drag-drop

Uncaught TypeError: Cannot set property 'effectAllowed' of undefined

Closed this issue · 6 comments

I just started integrating angular-drag-drop into my project. I'm running into this error (after just adding a drag module) around this line e.dataTransfer.effectAllowed = 'move';

I'm still a novice with directives, and am trying to read through to see what the problem is. It's correctly setting the dragged data, however not binding elem.bind correctly.

Hi,

Not exactly sure what's the problem is, had the same issue once.

When I use jsFiddle I have to write

e.originalEvent.dataTransfer.effectAllowed = 'move';

but when I include it in one of my projects

e.dataTransfer.effectAllowed = 'move'; is enough

so try with

e.originalEvent.dataTransfer.effectAllowed = 'move';

And let me know!

And what browser are you using?

This directive only works with HTML5 capable browsers.

Yeah, i saw that difference in the jsfiddle and changed it and it works. Strange.

Will look into it when I get back from vacation, not sure why it acts that way.

The drag attribute is also acting strange on my ng-repeat item. I have something like
`


{{event.name}}

`

The item is draggable and correctly drags the right event, however is not displaying event.name. If I take drag="event" off the div, things display properly.

I'm pretty sure I override the scope with an isolated scope.

try

item.name instead of event.name

I could work on it when I get back from vacation :)

Yup, that was it.