Угловая пользовательская директива
import { Directive, ElementRef } from '@angular/core';
@Directive({
selector: '[appHighlight]'
})
export class HighlightDirective {
constructor(private el: ElementRef) {
this.el.nativeElement.style.backgroundColor = 'yellow';
}
}
//To create a directive, use the CLI command
//ng g directive <name> [options]
simon caf