我需要阻止輸入選擇的選項「信用卡」或「借記卡」AngularJS NG-禁用傳遞多個表達式(用OR)
它適用於只是一種表達,當但是當我做所以在使用或不工作
app.controller('simuladorPedidoCtrl', function($scope) {
$rootScope.listaPagto = [{ name: "A vista", id: 1 }, { name: "Boleto", id: 2 }, { name: "Cheque", id: 3 }, { name: "Cartão de Débito", id: 4 }, { name: "Cartão de Crédito", id: 5 }, { name: "Indefinido", id: 6 }];
});
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<div ng-controller="simuladorPedidoCtrl">
<label for="FormaPagamento" class="control-label">Forma de Pagamento</label>
<select style="width: 100%" id="FormaPagamento" name="FormaPagamento" ng-model="model1.DadosPagamento.Forma" class="form-control">
<option value="">Selecione...</option>
<option ng-repeat="item in $root.listaPagto | orderBy:'name'" value="{{item.name}}">{{item.name}}</option>
</select>
<label for="CartaoNome" ng-disabled="" class="control-label">Name</label>
<input type="text" ng-disabled="model1.DadosPagamento.Forma != 'Cartão de Crédito' || model1.DadosPagamento.Forma != 'Cartão de Débito'" class="form-control" id="CartaoNome" name="CartaoNome" ng-model="model1.DadosPagamento.CartaoNome">
</div>
我有沒有解決這個問題? –