我正在使用angular drag drop list library来拖放列表中的项目。目前,我看到该项目在整个页面中都是可拖动的。如何将拖动区域限制为仅限于特定区域而不是所有区域。我检查了他们的API,但我没有看到任何选项。
答案 0 :(得分:0)
在plunker示例中,您不能拖放每个地方,只能在dnd-draggable
<ul dnd-list="list">
<!-- The dnd-draggable directive makes an element draggable and will
transfer the object that was assigned to it. If an element was
dragged away, you have to remove it from the original list
yourself using the dnd-moved attribute -->
<li ng-repeat="item in list"
dnd-draggable="item"
dnd-moved="list.splice($index, 1)"
dnd-effect-allowed="move"
dnd-selected="models.selected = item"
ng-class="{'selected': models.selected === item}"
>
{{item.label}}
</li>
</ul>