src/drop-target-specification.ts
The spec passed to SkyhookDndService.
Note the two type parameters. Both must represent plain JS objects. See the extended discussion of these type parameters at DragSourceSpec.
Methods |
Optional canDrop | ||||||
canDrop(monitor: DropTargetMonitor
|
||||||
Queries your component to determine whether an item can be dropped on this target. NOTE: runs outside Angular change detection. This is for performance
reasons. You shouldn't be making changes to your component here anyway. If
you do change your component inside this callback, it may not appear
immediately, and if you use Default, when not specified, is
Parameters :
Returns :
boolean
|
Optional drop | ||||||
drop(monitor: DropTargetMonitor
|
||||||
Called when a compatible item is dropped on the target. You may either return nothing, or a plain object. If you return an object, it is going to become the drop result and will be available to the drag source in its DragSourceSpec method as DropTargetMonitor. This is useful in case you want the source to perform different actions depending on which target received the drop. Otherwise, it is simpler to handle the dropped item here. If you have nested drop targets, you can test whether a nested target has
already handled drop by checking DropTargetMonitor. Both this
method and the source's This method will not be called if
Parameters :
Returns :
DropResult | void
|
Optional hover | ||||||
hover(monitor: DropTargetMonitor
|
||||||
Called frequently while the mouse hovers over the owner drop target while dragging a relevant item.
Parameters :
Returns :
void
|