I have a displayed table that includes a column called count
which has an <a>
tag with a href to a page.
I want to show a link for all rows where count > 0
and disable it when count=0
.
I attempted to use AngularJS - ng-disabled not working for Anchor tag and discovered that using ng-disabled
doesn't work in this case.
Using ng-class
seems like a viable solution, but I am struggling to specify the condition within ng-class
.
P.S. I want to add cursor:not-allowed
directly in ng-class
. I am unable to change the CSS.
Below is my HTML Code
<tr ng-repeat="service in services">
<td>{{$index+1}}</td>
<td>{{service.serviceName}}</td>
<td><a href="#/info/{{service.id}}">{{service.numberOfScenarios}}</a></td>
</tr>
numberOfScenarios
corresponds to the count
value.