フォームに選択ボックスがあり、検証を試みますが、入力タイプのテキストに対して以前と同じように動作しません。私は何を間違っていますか?
例
<div class="form-group">
<label class="control-label col-sm-3">Email<sup>*</sup></label>
<div class="col-sm-6">
<div class="input-icon-right">
<i class="fa fa-envelope"></i>
<input class="form-control" placeholder="example@example.com" type="email" ng-model="patient.email" name="email" required>
<p ng-show="myForm.email.$error.required" style="color:red" ng-if="myForm.email.$touched">Add your email</p>
</div>
</div>
</div>
このコードはうまく機能し、フィールドが空のときにエラーメッセージを表示します。
選択ボックスを使用したこのコードは正しく機能しません。毎回空を選択せずに-選択-を選択します。別のシックがないときにエラーを表示するにはどうすればよいですか。
<div class="form-group">
<label class="col-sm-3 control-label">{{getWord('Gender')}}<sup>*</sup></label>
<div class="col-sm-6">
<select ui-select2 ng-model="patient.gender"
data-placeholder="Tên Cơ Sở"
ng-change="changeGender()"
style="width: 100%;" requied name="gender">
<option value="">-{{getWord('Select')}}-</option>
<option ng-repeat="item in genders" value="{{item.name}}">
{{getWord(item.name)}}
</option>
</select>
<p ng-show="myForm.gender.$error.required" style="color:red" ng-if="myForm.gender.$touched">Please choice gender</p>
</div>
</div>