import { Component , DoCheck , HostListener } from '@angular/core' ; @ Component ( { selector : 'app-root' , templateUrl : './app.component.html' } ) export class AppComponent implements DoCheck { hidden = true ; changes = 0 ; @ HostListener ( 'dragenter' , [ '$event' ] ) @ HostListener ( 'dragover' , [ '$event' ] ) @ HostListener ( 'drop' , [ '$event' ] ) disable ( event ) { if ( event && event . dataTransfer ) { event . preventDefault ( ) ; event . dataTransfer . effectAllowed = 'none' ; event . dataTransfer . dropEffect = 'none' ; } } ngDoCheck ( ) { console . debug ( 'change-detection count: ' , this . changes ++ ) ; } }