How to make a ui-select field as required?

None of the answers really worked for me. I solved it using a simple hidden input with the same ng-model as the ui-select and validating that in the form.

<input type="hidden" name="email_domain_pattern" ng-model="settings.emailDomainPatternList" required/>

You can write ng-required="true".

<div class="form-group">
    <label class="col-xs-5 control-label"> Settings*</label>

    <div class="col-xs-7">
        <ui-select multiple tagging="adPreferredEmailDomainPatternTransform"                 
                   id="emailDomainPatternListInput"
                   tagging-tokens="SPACE|," 
                   theme="bootstrap"
                   ng-disabled="settings.enableAuthentication == 'false'"
                   ng-model="settings.emailDomainPatternList"
                   ng-required="true">
            <ui-select-match>{{$item.displayFormat}}</ui-select-match>
            <ui-select-choices repeat="item in emailDomainPatterns">
                {{item.displayFormat}}
            </ui-select-choices>
        </ui-select>
    </div>
</div>

Tags:

Html

Angularjs