angular directive
// just use it normal
@Output() itch:EventEmitter<any> = new EventEmitter();
//and call in html
<div appCollar (itch)='scratch()' >//generate Angular Directives
ng generate directive highlight
//it will generate the following component
import { Directive, ElementRef } from '@angular/core';
@Directive({
selector: '[appHighlight]'
})
export class HighlightDirective {
constructor(el: ElementRef) {
el.nativeElement.style.backgroundColor = 'yellow';
}
}
// you can use the directive in the template as:
<p appHighlight> highlighted text </p>import { Directive, ElementRef } from '@angular/core';<p [ngStyle]="{`THE CSS YOPU WANT TO ADD`}"> I am an Attribute Directive</p>
content_copy
ng generate directive highlight
Also in JavaScript:
- remove a value to an array of javascript
- angular vs react vs vue
- jquery clear file input
- array sorting javascript mergesort
- how to move an element to the cursor in javascript
- permission api js
- hoe verbind je de nodemcu 8266 met adafruit io
- hook access loopback
- js isset
- add coustom handlechange fprmik
- count the number of spacesinto a string javascript
- redondear de 0.05 en 0.05 javascript
- mobile number format (xxx) xxx-xxxx
- how to add multiple comment in react
- javascript get elements that exist in two arrays
- local storage
- how to make an image like canvas in node js
- or operator javascript
- detect if user is online react
- How many different types of JS alerts do we have?
- jquery only number allowed to 10 digit
- same name different extentions react-native android
- display array in div javascript
- node js read files recursively