I'm trying to figure out how to disable dropping using CDK based on certain conditions. Specifically, I want the drop functionality to be disabled if the list I'm attempting to drop into is empty. I haven't been able to find a solution within my .ts file methods. While there are some HTML directives that could potentially help with this issue, they aren't suitable for my needs.
if(event.container.data.length==1){
event.previousContainer.disabled=true;
}
I came across the .disabled method for dragged containers, but it only seems to work when dragging. What I need is an event trigger for dropping.
https://stackblitz.com/edit/angular-ui7u9m?file=src/app/cdk-drag-drop-disabled-sorting-example.ts
In the stackblitz example provided, there are two lists. For instance, if the 'Available' list is empty (no elements in the array), dropping should no longer be allowed into this list. Can anyone assist me in achieving this functionality?