import { Directive , ElementRef , Renderer } from '@angular/core' ; @ Directive ( { selector : '[appHighlight]' } ) export class YellowHighlightDirective { constructor ( renderer , el ) { renderer . setElementStyle ( el . nativeElement , 'backgroundColor' , 'yellow' ) ; } }