event.stopPropagation()和之间有什么区别event.stopImmediatePropagation()?
我的代码看起来像这样:
<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>
Run Code Online (Sandbox Code Playgroud)
我想这样做,以便当access.authenticated为false时,无法单击该链接.我想到的是将链接更改为按钮,然后将其设置为链接样式.但是这不起作用,因为按钮不会导致页面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>
Run Code Online (Sandbox Code Playgroud)
有人能告诉我如何做我需要的东西吗?