Currently, I am in the process of constructing an angular application and have encountered an issue that I need assistance with.
Here is a snippet of my code:
<div ng-class="{selectThis : item.pick}" ng-click="pickItem(item)" class="item">Item name here<div>
My JavaScript controller looks like this:
$scope.pickItem = function(item) {
item.pick = true;
}
Within my CSS file:
.item {
color: red;
…more css
}
.item:hover {
color:blue;
...more css
}
.selectThis {
color:blue;
}
While everything appears to be functioning correctly on desktops, the hover effect persists on touch devices when a user touches the div. I am aware that adding a media query could resolve this issue, but I believe there may be a more modern Angular-based solution available. Any suggestions would be greatly appreciated. Thank you!