Angular Material: 删除 cdk 组件外的项目 onDrop

Angular Material: Remove item onDrop outside cdk component

我目前正在使用 angular material CDK DragAnDrop 来实现某些列表功能。
我想要完成的是:

Is there some directive or api that I can use to validate that I'm dropping an element outside cdkDropList component?

您可以使用 CdkDragDrop 事件的 isPointerOverContainer 属性。

如果物品掉落到容器外,它将被设置为 false,否则为 true。