Answers for "angular custom directive"

0

angular custom directive

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]
Posted by: Guest on April-26-2022

Code answers related to "angular custom directive"

Code answers related to "Javascript"

Browse Popular Code Answers by Language