我希望我的按鈕僅在選擇區域中選擇了其中一個選項時才顯示。僅當選擇了選項時顯示按鈕
<div class="row" ng-controller='ctrl1'>
<div class ="form_group">
<select class="form-control" ng-options='item as item.hotel_name for item in hotels.data' ng-model='current_Hotel' ng-click="selectHotel()"><option value="" selected disabled>Choose a hotel</option>
</select>
</div>
<div class="col-md-6">
<h1>{{current_Hotel.hotel_name}}</h1>
<p>{{current_Hotel.hotel_description}}</p>
<img class="img img-responsive" ng-src="{{current_Hotel.image_url}}">
<btn class="btn btn-primary">Book a room </btn>
</div>
</div>
我試過使用ng-show和ng-hide,但它沒有按照我的要求工作。
嘗試對按鈕使用'ng-show'指令。它非常簡單而有效。 –
'ng-show'條件'selectedOptions.length> 0' –