HTML代码中的所选项目我想采用了棱角分明
<div ng-controller="DropdownCtrl as vm">
<select name="singleSelect" ng-model="data.model"
ng-change="vm.userSelect(data.model)"
ng-click="vm.loadTenantList()">
<option ng-repeat="tenant in vm.tenants" >{{tenant.name}}</option>
</select><br>
</div>
js代码
$lmsapp.controller('DropdownCtrl',['tenantServices','dialogService',function (tenantServices,dialogService,$log){
var vm = this;
vm.tenants=[];
vm.loadTenantList=function(){
tenantServices.tenantList({},function(response){
vm.tenants=response.dataList;
});
};
vm.data = {
availableOptions: [
vm.loadTenantList()
]
};
}]);
我怎样才能得到所选择的元素?
我应该怎么做在控制器 –
没有必要做任何事情在控制器可能是你可以initlize vm.selectedTenant = {},但这不会有任何区别。 – Ruhul
,我怎样才能使它作为默认参数使用$ http –