ng-click。 如何防止这种情况发生。
<div class="fila">
<div class="seccion">
<div class="asiento">
<input ng-checked="seatLayout[0].reserved " ng-disabled="seatLayout[0].reserved || result.length == parseInt(maxSeats) "
type="checkbox" value="None" id="asiento1" name="check"/>
<label ng-class="{'selected' : seatLayout[0].reserved == true, 'notselected' : seatLayout[0].reserved == false}"
ng-click="addSeat(seatLayout[0])"
for="asiento1">{{seatLayout[0].id}}</label>
</div>
</div>
</div>
答案 0 :(得分:0)
您可以将ng-disabled条件添加到ng-click,如下所示:
ng-click="(seatLayout[0].reserved || result.length == parseInt(maxSeats) ) || addSeat(seatLayout[0])"
这将阻止条件为真时单击标签。