我需要知道是否有可能将angular的拖放与返回我的数组的方法一起使用,并且仍然设法将两个拖放连接起来。
类似:
<div *ngIf="render">
<div class="container-drag-drop">
<div (cdkDropListDropped)="dropFirst($event)" cdkDropList #free="cdkDropList" [cdkDropListConnectedTo]="[dontFree]" [cdkDropListData]="firstMethod()" class="list-drag-drop">
<div class="box-drag-drop" *ngFor="let codTemp of firstMethod()" cdkDrag>{{codTemp}}</div>
</div>
</div>
</div>
<div *ngIf="render">
<div class="container-drag-drop">
<div (cdkDropListDropped)="dropSecond($event)" cdkDropList #dontFree="cdkDropList" [cdkDropListConnectedTo]="[free]" [cdkDropListData]="secondMethod()" class="list-drag-drop">
<div class="box-drag-drop" *ngFor="let codTemp of secondMethod()" cdkDrag>{{codTemp}}</div>
</div>
</div>
</div>
可以执行类似的操作,通过触发dropSecond事件可以从array1中删除项目,而通过触发dropFirst事件也可以发生相反的情况?