ui-选择必填字段验证

时间:2016-02-02 10:10:14

标签: angularjs ui-select angular-ui-select

我们是否可以将默认的HTML必填字段验证警告框设置为UI-Select,如同给定链接中的那个..如果是这样的话?

https://www.google.co.in/imgres?imgurl=http://i.stack.imgur.com/R3h1L.png&imgrefurl=https://stackoverflow.com/questions/18770369/how-to-set-html5-required-attribute-in-javascript&h=178&w=675&tbnid=j8M7AwOECpa80M:&docid=NL_CUnsolMwYCM&ei=HICwVtbjJouyuASina_4Dg&tbm=isch

编辑:我的代码就像

<ui-select ng-model="selectedName" name="nameSelect" required>
   <ui-select-match allow-clear="true" placeholder="Select a value">
   {{$select.selected.firstname + ' ' +$select.selected.lastname }}
   </ui-select-match>
   <ui-select-choices repeat="name in names | propsFilter: {firstname: $select.search, lastname: $select.search}" >
       <div ng-bind-html="name.firstname +  ' '+name.lastname   | highlight: $select.search">
       </div>
  </ui-select-choices>
</ui-select>

将名称列为用户的名字和姓氏。

0 个答案:

没有答案