1
我正在創建一個web應用程序,我使用引導selectpicker選擇..但我使用angularjs來填充選擇選擇器..我有2選擇一個內容的基礎上填充無需重新加載..我能很好地工作它而不selectpicker雖然它不工作時使用selectpicker第一選擇值..我的代碼是Angularjs不工作在引導selectpicker
<div class="form-group" data-ng-controller="MARK_ENTRY_CONTROLLER">
<div class="row">
<div class="col-md-6 " style="margin-top: 7px;">
<label>Select Class</label>
</div>
<div class="col-md-6 text-center">
<select class="form-control" title="Select Class"
name="fromClass" ng-change="EXAM_LIST_JSON(fromClass)"
ng-model="fromClass"
ng-options="fromClass.id as fromClass.course + ' ' + fromClass.section for fromClass in ALL_CLASS">
</select>
</div>
</div>
<div class="row" style="height: 10px"></div>
<div class="row">
<div class="col-md-6 " style="margin-top: 7px;">
<label>Select Examination</label>
</div>
<div class="col-md-6 text-center" >
<select class="form-control" name="examination"
ng-change="SUBJECT_LIST_IN_EXAM_JSON()"
ng-model="examination"
ng-options="examination.id as examination.name for examination in EXAM_LIST"></select>
</div>
</div>
和控制器
<script>
function MARK_ENTRY_CONTROLLER($scope, $http) {
$http.get("<%=request.getContextPath()%>/ALL_CLASS_JSON?AAdvisorId=${uid}").success(function(response) {
$scope.ALL_CLASS = response;
$scope.EXAM_LIST_JSON = function(id){
$http.get("<%=request.getContextPath()%>/EXAM_LIST_JSON?fromClass="+id)
.success(function(response) {
$scope.EXAM_LIST = response;
$scope.$apply();
});
}
});
}
</script>
在這裏,在控制器的數據的列表是從一個JSON文件使用JSON格式獲得.. 請幫我..
你救了我的一天。謝謝! – Margaret 2016-09-23 12:57:22
是否有可能不依賴於jQuery? – ellockie 2017-11-28 17:42:13