There's a situation I'm dealing with that involves a select dropdown along with a refresh button and a plus button. The issue arises when clicking the refresh button sets the model to null, while clicking the plus button displays the dropdown with an empty option. My goal is to have the dropdown appear without the empty option only when the ng-model
is null.
Below is the code snippet:
<div class="col-xs-6 npd">
<div ng-if="minAge==null">
<select ng-options="minAge.val as minAge.txt for minAge in ddloptions" ng-model="minAge" ng-change="ageCheck()">
</select>
<p>Select <br><span>Minimum age</span></p>
</div>
<div ng-if="minAge!=null">
<a ng-click="minAgeRmv()"><img src="images/prf-mprmv.png" /></a>
<p>Minimum age <br><span>{{minAge}}</span></p>
</div>
</div>
I would greatly appreciate any assistance on this matter.