【发布时间】:2017-01-03 07:56:17
【问题描述】:
我有两个下拉选择框,我使用 AngularJS 在下拉列表中显示选项。
在我的脚本中,当我使用$(".select2_demo_1").select2(); 时,一次只有一个下拉菜单显示选定的选项。我想显示两个下拉菜单以显示选定的选项。需要帮助。
<select id="one" class="select2_demo_1 form-control" ng-model="orgs" ng-options="item.OrganizationTypeTitle for item in organization"></select>
<select id="two" class="select2_demo_1 form-control" ng-model="industry" ng-options="i.IndustryTypeTitle for i in industries"></select>
var getOrganizationTypes = OrgService.getOrganizationTypes();
getOrganizationTypes.then(function (response) {
$scope.organization = response.data;
$scope.orgs = $scope.organization[0];
}, function () {
alert('can not get Organization Types!');
});
var getIndustryTypes = OrgService.getIndustryTypes();
getIndustryTypes.then(function (response) {
$scope.industries = response.data;
$scope.industry = $scope.industries[0];
}, function () {
alert('can not get industry types');
})
【问题讨论】:
标签: jquery angularjs select2 angularjs-select2