i have an angular click event attached on span in my component's html
<span (click)="doWork($event)" > Something </span>
and in my component i want to perform some operation and than add a class to this span using renderer2's addClass method. I injected Renderer2 from constrctor and used it in function
doWork (e) {
//some operations
this.renderer.addClass( e.target, 'selected' );
}
but i am unable to attach class on span in this way, am i missing something?