在下面的按钮代码中,我添加了ng disabled条件,当我使用" qty> 10"时,它正在工作,但是当我添加" qty> maxqtySeats"时,相同的条件在其中" maxqtyseats"是我的范围变量,我在其中分配了值并在html页面上打印而不使用条件。
。以下是模态的代码
<div class="rectangleSeats">
<div style="width: 300px; float: left;">
<span class="removeSeatstxt" l10n-text="cancellation.removeSeats"></span>
<br/><br/>
<span class="opt-box" style="font-size: 12px;" l10n-text="cancellation.seatstoRemove"></span>
</div>
<div class="quantity buttons_added" style="float: right;">
<form id='myform' ng-app="gemAppSu" ng-controller="ModalInstanceCtrl">
<button ng-click="decrement()" class='qtyminus' ng-disabled="qty<=0" style="background-color: transparent;border: none;">
<img src="assets/img/minus.svg" width="12px" height="12px"/>
</button>
<input ng-model="qty" type='text' name='quantity' id='qty' class='qty' style="font-size: 12px; font-weight: bold;
border: none;height: 44px;width: 52px;text-align: center;"/>
<button ng-click="increment()" style="background-color: transparent;border: none;">
<img src="assets/img/plus.svg" width="12px" height="12px"/>
</button>
</form>
</div>
</div>
<div class="cancellationbtndiv" >
<button type="button" class="btn btn-default nxt-btn" ng-disabled="qty > maxQtySeats">
<span l10n-text="cancellation.buttonnext"></span></button>
</div>
controller.js
$ scope.maxqtyseats = 0; $ scope.maxqtyseats = $ scope.activeItem.lineItem.totalquantity;
得到解决方案...
这是parseint((的问题,在parseint($ scope.activeItem.lineItem.totalquantity(之后,它很好。
谢谢。