I am creating a web application where i am using bootstrap selectpicker for select.. But i am using angularjs to populate the select picker.. I have 2 select where the content of one is populated based in first select value without reloading.. I am able to work it perfectly without selectpicker while it doesn't work when a selectpicker is used.. my Code is
<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>
and controller is
<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>
Here in controller the List of data is obtained from a json file using json format.. Please help me out..