/* tslint:disable:member-ordering */ import { Directive, ElementRef, Input ,HostListener} from '@angular/core'; import { debug } from 'util'; @Directive({ selector: '[highlightcolor]' }) export class highlightcolor { highlightColor:string; _Index:any; constructor(private el: ElementRef) { this.el; } @Input() set highlightcolor(obj:any) { this.highlightColor = obj.highlightcolor; this._Index=obj.Index; // debugger }; @HostListener('mouseenter') onMouseEnter() { this.el; this.highlight(this.highlightColor || '#ebf7ff',this._Index); } @HostListener('mouseleave') onMouseLeave() { this.highlight(null,this._Index); } private highlight(background: string,index:string) { this.el.nativeElement.style.backgroundColor = background; } } /* Copyright 2017 Google Inc. All Rights Reserved. Use of this source code is governed by an MIT-style license that can be found in the LICENSE file at http://angular.io/license */