I have this component template:
<div id="one" (click)=""></div>
<div id="two" #two></div>
What should I put inside (click)=""
to assign the second div some class. I know it can be done inside component code, but is there a way to do it directly in template?
(click)="two.className = 'someClass'"
or
(click)="two.classList.add('someClass')"
See also Change an element's class with JavaScript
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With