SITUATION:
I have an angular app sending emails. There is a form with three fields: Address - Subject - Text.
In the address field I use angular ui-select .
Everything works fine, except for checking in the address field (on the topic and checking the text works correctly).
EDIT:
This error has been fixed since version 0.16.1. as pointed out by @yishaiz.
Thus, this question and its relative solution consider versions ui-select <0.16.1.
THE CODE:
HTML:
<form name="emailForm" ng-submit="submitForm(emailForm.$valid)"> <div class="row form-group"> <label class="col-sm-2 control-label">To: </label> <div class="col-sm-10"> <ui-select multiple ng-model="database_people.selectedPeople" theme="select2" ng-disabled="disabled" style="width:100%"> <ui-select-match placeholder="Select person...">{{$item.name}} < {{$item.value}} ></ui-select-match> <ui-select-choices repeat="person2 in list_people | filter: {name: $select.search.name, value: $select.search.value, db_data_type_id: 5}"> <div ng-bind-html="person2.name | highlight: $select.search"></div> <small> email: <span ng-bind-html="''+person2.value | highlight: $select.search"></span> </small> </ui-select-choices> </ui-select> </div> </div> <div class="col-sm-8"> <button type="submit" class="btn btn-primary">Send</button> </div> </form>
ANGULARJS:
$scope.submitForm = function(isValid) { if (isValid) { alert('valid'); } else { alert('not valid') } };
PLUNKER:
http://plnkr.co/edit/MYW7SM9c9anH6RTomfRG?p=preview
As you can see, ui-select is required, but the form is considered strong.
Question (s):
How can I make the required ui-select multiple?
source share