angular directive example
//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>
content_copy
ng generate directive highlight
Also in JavaScript:
- showing file download progress in angular
- node module export multiple functions
- jquery function return
- how to generate random string in javascript
- react chunk file too large
- promise catch
- math.floor js
- jspdf reduce size file
- javascript get cpu cores
- How do you wait for 5 seconds in JavaScript?
- for in and for of in js
- url redirect javascript
- express js continous GET /json/version
- the original image of nodejs image
- how to define variable in javascript
- js create object url base64 pdf binary
- javascript array add
- swap scroll right in react native
- rotate a div using javascript
- ignore node_modules
- js running function as parameter
- javascript character ascii value modify
- javascript array filter
- jquery do something if toggle open and close