您好我正在創建角度js下拉列表,同時選擇一些空格將附加到下拉值的值。從下拉列表中選擇數據時的空格
模板
<div class="row control-group">
<label class="col-xs-4 col-sm-4 col-md-3 col-lg-3 control-label">{{::'label.identity'|translate}}</label>
<div class="col-xs-7 col-sm-7 col-md-9 col-lg-9 controls">
<select id="selectIdentity" name="selectIdentity" required ng-trim="true" ng-change="changedValue(addUser.identityProvider)" ng-model="addUser.identityProvider" >
<!-- Empty option necessary for placeholder to work -->
<!-- <option value="">{{::'define.selectval'|translate}}</option> -->
<option ng-repeat="idprovider in identityProvider"
ui-select2="select2IdentityProvider"
class="selectIdentity"
ng-selected="identityProvider"
ui-select2="select2LocaleSettings">
{{idprovider}}
</option>
</select>
<span class="help-block"
ng-show="addUserForm.selectIdentity.$error.required">
{{::'error.required'|translate}}
</span>
</div>
</div>
JS代碼
$scope.identityProvider = ['Customer','Employee'];
UI,選擇2已經過時,你應該嘗試使用UI - 選擇:https://github.com/angular-ui/ui-select –
沒有仍然不工作 – priyanka
你能提供一個jsfiddle或什麼東西來顯示你到底是什麼問題? – ThomasS