import { ElementRef , Directive , Inject , PLATFORM_ID , EventEmitter } from '@angular/core' ; import { InViewportDirective , InViewportService } from 'ng-in-viewport' ; @ Directive ( { exportAs : 'ngxDropdownMenu' , selector : 'ngx-dropdown-menu' , host : { class : 'ngx-dropdown-menu' } } ) export class DropdownMenuDirective extends InViewportDirective { readonly element : HTMLElement ; constructor ( @ Inject ( PLATFORM_ID ) readonly _platformIdentifier , readonly _elementReference , readonly _insideViewport ) { super ( _platformIdentifier , _elementReference , _insideViewport ) ; this . element = this . _elementReference . nativeElement ; } getCallbackFn ( ) { return this . inViewportAction ; } }