'required'属性在angularstrap选择框中不起作用。如果未从下拉列表中选择值,则需要红色边框。
<button type="button"
class="btn btn-default"
ng-model="clearingType"
data-html="1"
bs-options="(clearingType.code+'-'+clearingType.description) as (clearingType.code+'-'+clearingType.description) for clearingType in clearingTypes"
placeholder="Please Select"
data-ng-change="getEffectiveDate()"
bs-select
focus-on="focusInput" required>
Action <span class="caret"></span>
</button>
答案 0 :(得分:0)
我使用ng-class
找到了我的问题的解决方案data-ng-class="{'hasError':hasError}"
和css,
.btn.hasError{
border:1px solid red !important;
}