I'm trying to create a file drag and drop upload. I've created the div container with the dragenter, dragleave and drop events with HostListener in an Angular Directive. The dragenter and the dragleave event are working, but in the drop event the event.preventDefault() is not working. My event code:
@HostListener('drop', ['$event']) onDrop = (event): void => {
event.preventDefault();
}
I also tried to add the event with (drop)="function($event)"
inside the HTML DOM but that didn't work either.