import { Directive , ElementRef , HostListener , Input } from '@angular/core' ; import { HasUniqueIdentifier , Heap } from '@app/models' ; import { CellService , JsPlumbService } from '@app/services' ; @ Directive ( { selector : '[nbtutorAnchorFrom]' } ) export class AnchorFromDirective { @ Input ( ) heap : Heap ; @ Input ( 'nbtutorAnchorFrom' ) from : HasUniqueIdentifier ; constructor ( protected _cellSvc , protected _jsPlumbSvc , protected _elementRef ) { } @ HostListener ( 'mouseenter' ) onMouseOver ( ) { this . _cellSvc . setHover ( { from : this . from , to : this . heap . entities [ this . from . id ] } ) ; this . _jsPlumbSvc . toggleHoverClass ( this . from . uuid ) ; } @ HostListener ( 'mouseleave' ) onMouseOut ( ) { this . _cellSvc . setHover ( null ) ; this . _jsPlumbSvc . toggleHoverClass ( this . from . uuid ) ; } }