<!--<li ng-class="{active: aba == 1, disabled: autenticarAcessoAba(1) }">-->
<li ng-class="{'active': aba =='2' , disabled: autenticarAcessoAba(2) && !aba=='2' }">
$scope.autenticarAcessoAba = function(aba){
return aba > $scope.ultimaAba;//setar disabled como class
}
我是对手&#39; aba&#39;,有效并禁用其他人&#39; aba&#39;
答案 0 :(得分:0)
你可以用这个
ng-class="{'active': condition,disabled: functionWhichDecidesTruthyOrFalse(1)}"
答案 1 :(得分:0)
该函数应返回true
或false
并将其添加到ngClass
表达式
<li ng-class="{active: aba == 1 && !myFunc(1), disabled: myFunc(1)}">
$scope.myFunc= function(aba){
return aba > $scope.ultimaAba;
}