Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/amazon-s3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 控制要从对象拖放的内容_Javascript_Angular_Sortablejs - Fatal编程技术网

Javascript 控制要从对象拖放的内容

Javascript 控制要从对象拖放的内容,javascript,angular,sortablejs,Javascript,Angular,Sortablejs,我使用ngx sortableJS进行拖放 我有“工具”div,从这里我获取(拖动)项目和放置区域div 我在tools中的项目是对象,我需要这个数据对象在tools div中显示图标和img cons tools = [ { name: 'tool1', data: { icon: 'text_fields', type: 'tools' } }, { name: 'tool2', data: { icon: 'text_fields', type: 'tools' } }, { name:

我使用ngx sortableJS进行拖放

我有“工具”div,从这里我获取(拖动)项目和放置区域div

我在tools中的项目是对象,我需要这个数据对象在tools div中显示图标和img

cons tools = [
{ name: 'tool1', data: { icon: 'text_fields', type: 'tools' } },
{ name: 'tool2', data: { icon: 'text_fields', type: 'tools' } },
{ name: 'tool3', data: { icon: 'text_fields', type: 'tools' } },
]
现在,我想,当我拖动此项的某些内容时,从已删除的对象中获取并删除唯一的名称

{ name: 'tool1' }
有没有一种方法可以控制我们想要拖放什么,或者我们需要始终拖放整个对象

这是


Thnx

@JohnPeters angular CDK没有我需要的所有功能。thnx您需要将元素从第一个列表移动到第二个列表,还是只在第二个列表中添加一个新项目?您是否也需要从第二个列表移动到第一个列表?另外,您知道Angular有一个结构类型系统,这样您就可以编写
this.normalList2.push(this.normalList1[0])?所以我不明白为什么Angular的DnD特性在这里不起作用。嗨,我需要从第一个列表移动到第二个列表。