My code is as follows:
<a ng-disabled="!access.authenticated"
data-ng-class="{ 'current': $state.includes('home'), 'disabled': !access.authenticated } "
href="/home/overview"
title="Home">
<i class="fa fa-home fa-fw"></i>
</a>
I want to make it so that when access.authenticated is false, the link cannot be clicked. What I was thinking of is changing the link to the button, and then styling it as a link. However, this does not work, since the button does not change the page URL.
<button ng-disabled="!access.authenticated"
data-ng-class="{ 'current': $state.includes('home'), 'disabled': !access.authenticated } "
href="/home/overview"
title="Home">
<i class="fa fa-home fa-fw"></i>
</button>
Can someone tell me how I can do what I need?
user3568783
source
share