import { Directive , ViewContainerRef , Input , OnInit , Output , EventEmitter } from "@angular/core" ; declare var jQuery ; link @ Directive ( { selector : "[smDirVisibility]" } ) export class SMVisibilityDirective implements OnInit { @ Input ( ) smDirVisibility : { } ; @ Output ( ) onTopVisible : EventEmitter < { } > = new EventEmitter < { } > ( ) ; @ Output ( ) onTopPassed : EventEmitter < { } > = new EventEmitter < { } > ( ) ; @ Output ( ) onUpdate : EventEmitter < { } > = new EventEmitter < { } > ( ) ; constructor ( public element ) { } ngOnInit ( ) { if ( this . element . element . nativeElement ) { jQuery ( this . element . element . nativeElement ) . visibility ( { onTopPassed : ( calculations ) => this . onTopPassed . emit ( calculations ) , onTopVisible : ( calculations ) => this . onTopVisible . emit ( calculations ) , onUpdate : ( calculations ) => this . onUpdate . emit ( calculations ) , } ) ; } } } link @ Directive ( { selector : "[smDeviceVisibility]" } ) export class SMDeviceVisibilityDirective implements OnInit { @ Input ( ) smDeviceVisibility : string ; constructor ( public element ) { } ngOnInit ( ) { this . element . element . nativeElement . classList . add ( ... this . smDeviceVisibility . split ( " " ) ) ; } }