I have been working on a new feature that involves highlighting a div in a specific color and changing the mouse pointer to a hand cursor. I successfully achieved this by adding a CSS class:
.changePointer:hover {
cursor: pointer;
background-color: rgb(231, 222, 222);
}
The functionality works as expected when hovering over the div. However, my goal is to trigger this effect only upon clicking a button. I am using Angular 7 for this project. I attempted to utilize
[ngClass]="{'someClass': highlightText}"
, updating the highlightText
boolean to true
upon button click, but unfortunately, it did not produce the desired outcome. Does anyone have any suggestions?