addclass to elementref angular
export class CustomDirective {
constructor(private renderer: Renderer2,
private elementRef: ElementRef,
service: SomService) {
}
addClass(className: string, element: any) {
this.renderer.addClass(element, className);
// or use the host element directly
// this.renderer.addClass(this.elementRef.nativeElement, className);
}
removeClass(className: string, element: any) {
this.renderer.removeClass(element, className);
}
}
Also in JavaScript:
- addclass to elementref angular
- else in javascript
- syntax to call item from array
- reactjs facebook login popup trigger on load page
- how to give css style in javascript
- javascript null or object
- node js send fcm
- pause javascript
- how will it look when there is a container inside a a row bootstrap
- name class and id referance in ajax
- callout react
- state wheteher true or false The charioteer sprinkled sacred water on the king.
- how to get tomorrow date in javascript
- nodejs express routing
- js dictionary
- get last item in map javascript
- dynamic loaded content can't find library jqury
- javascript remove last element from array
- do more than one thing at start of or loop javascript
- javascript randint
- class javascript
- how to create dynamic classes in tailwind typescript react
- json property becoming small after retriving from .net core controller
- javascript capitalize