每次使用Angular.js单击按钮时,我都无法打开模式弹出窗口。
这是我的代码:
<button tybe="button" class="btn btn-xs btn-link" style="padding: 0px 4px;" ng-click="getPriceDetails();">Get Price Details</button>
<modal title="Tariff Information" class="viewpricemodal" visible="priceDetails">
<h4 class="text-center">Total Fare ₹76</h4>
<img src="" alt="">
<table class="table table-hover">
<tbody>
<tr>
<td>Basic Fare</td>
<td align="right">₹70</td>
</tr>
<tr>
<td>Rate per km</td>
<td align="right">₹2</td>
</tr>
<tr>
<td>Ride time charge per min</td>
<td align="right">₹1</td>
</tr>
</tbody>
</table>
<p class="text-center">Total fare may change if route or destination changes or if any ride takes longer due to traffic or other factors.
Total fare doesn't include waiting fee.</p>
</modal>
$scope.getPriceDetails=function(){
//$scope.priceDetails=false;
//console.log('price',$scope.priceDetails);
$scope.priceDetails = !$scope.priceDetails;
}
在这里,我可以在两次单击该按钮后打开弹出模式。我需要每次单击该模式应该打开的按钮。我正在使用angular.js ui-bootstrap
作为模式弹出窗口。