Answers for "how to add class using nativeelement in angular"

1

nativeelement angular add class

constructor(public elementRef: ElementRef, private renderer: Renderer)
{
        this.renderer.setElementClass(this.elementRef, 'class');
   // or 

            this.elementRef.nativeElement.classList.add('class');

}
Posted by: Guest on May-11-2021

Code answers related to "how to add class using nativeelement in angular"

Code answers related to "Javascript"

Browse Popular Code Answers by Language