Skip to content

Instantly share code, notes, and snippets.

@wKoza
Last active May 22, 2017 15:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wKoza/0a7a7f7e2c1dde7a9c80fd863c1a109e to your computer and use it in GitHub Desktop.
Save wKoza/0a7a7f7e2c1dde7a9c80fd863c1a109e to your computer and use it in GitHub Desktop.
import {Directive, Renderer2, ElementRef} from '@angular/core';
@Directive({
selector: '[appHighlight]'
})
export class HighlightDirective {
constructor(el: ElementRef, renderer: Renderer2) {
renderer.setStyle(el.nativeElement, 'color', 'red');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment