You should subscribe to the drop event, and when it's outside the container, you can ask for confirmation in a callback.
import { Subscription } from 'rxjs';
import { DragulaService } from 'ng2-dragula';
export class MyComponent {
subs = new Subscription();
constructor(private dragulaService: DragulaService) {
this.subs.add(this.dragulaService.drop("VAMPIRES")
.subscribe(({ name, el, target, source, sibling }) => {
//something like:
if(target.className != 'container') {
this.dragulaService.find('container').drake.cancel(confirm(
"Do you really want to erease me? Do you really want to wipe me out?!"))}
})
);
}
ngOnDestroy() {
// destroy all the subscriptions at once
this.subs.unsubscribe();
}
}