How can I create an AngularJS dropdown that requires a selection only when a specific variable, such as 'x', is set to true? If 'x' is false, it should allow saving without a selection. Below is the code for my dropdown:
<select class="form-control dropdownheight"
ng-model="search.hardware"
ng-change="search()" >
<option value="" selected>Select Hardware</option>
<option ng-repeat="box in boxes" value="{{box.name}}">{{box.name}}</option>
</select>