I’m building an app that needs to feature Drag & Drop as an interaction mode. Specifically, imagine an Ionic Side Menu
, containing an <ion-list>
of people. Any one of these people in the list should be able to be dragged and dropped into a container, somewhere in the view (but not dropped back into the <ion-list>
. Now, a problem and a question:
Problem: I implemented an Angular Drag & Drop library (http://www.directiv.es/Angular-DragDrop). It seems to work - inasmuch as a ghost image is draggable. But, a TypeError: e.gesture is undefined
is thrown, in ionic.bundle
, line 6917. Why is this error being thrown, as soon as I click a person in the list and start dragging? More importantly, how to correct this?
Question: This may be more of an Angular than Ionic question, but here goes: The <ion-list>
containing the people list is under the control of one Controller
(say, ControllerA
), while the container into which a person from this list is to be dropped is under the control of another Controller
(say, ControllerB
). Now, is it actually possible to have the Drag part of Drag & Drop reside in one Controller
, and the Drop part of Drag & Drop reside in another? It’s not working for me, and I don’t know if it’s because of the undefined gesture or - even if gesture were defined and not in error - it’s because the same Controller
is not handling both Drag and Drop. (Both the container and the list have the required Directive
s present in the template, and functions to handle the Drop are defined.) If the Drag & Drop can be split across two different Controllers, then presumably you’d need to either use $broadcast/$on
or a shared Service
to handle the interaction between them, right? Can anyone clarify this?
Anyway, first things first: How to solve the TypeError: e.gesture is undefined
error being thrown at the start of a Drag operation. All help much appreciated - thank you!