Show forbidden icon on hover when ng-click is not available


I know that this can be made for an icon. I’m wondering if it is possible for a span as it is in my case.

<span ng-click="!$ctrl.clicked && $ctrl.doSomething()" 
      ng-class="$ctrl.clicked ? 'unclickable' : 'clickable'">
      Click here!

This is my code so far, it uses ng-class to change the color of the text if it is clickable or not.

What I want to add is to have a forbidden-icon when I hover over the text. Is it possible in this case? (without changing from span to other)


In your css you should be able to add a “cursor: not-allowed;” in the “unclickable” class.

Answered By – Robbie

Answer Checked By – Mary Flores (AngularFixing Volunteer)

Leave a Reply

Your email address will not be published.