Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

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]
Comment

PREVIOUS NEXT
Code Example
Javascript :: repeat js 
Javascript :: how to install node js dependencies from package.json 
Javascript :: javascript for in 
Javascript :: afficher une variable dans la console javascript 
Javascript :: js get last n elements of array 
Javascript :: pass data ino pug nodejs 
Javascript :: create shadow root 
Javascript :: how to check if string contains substring javascript 
Javascript :: form contact 7 ajax send 
Javascript :: what is getter and setter in javascript 
Javascript :: check phone number validation in javascript 
Javascript :: how to get firebase document id angular 
Javascript :: jquery slider 
Javascript :: date object js 
Javascript :: javascript foreach in object 
Javascript :: 1 line password strength checker jquery 
Javascript :: html call variable javascript 
Javascript :: good javascript ide 
Javascript :: search with multiple field in node js mongodb 
Javascript :: javascript export default 
Javascript :: js get children last 
Javascript :: floor javascript 
Javascript :: change text based on dropdown selection javascript 
Javascript :: js alertify.success parameters 
Javascript :: show selected image input file from database 
Javascript :: while loops js 
Javascript :: how to delete an element from an array 
Javascript :: rivets js bind 
Javascript :: ABORT CONTROLLER WITH ASYNC USEEFFECT REACT 
Javascript :: javascaript 
ADD CONTENT
Topic
Content
Source link
Name
8+6 =