I am creating a form that contains multiple select options that should be populated from a database query. Each set of options for a dropdown comes from a different query. I am able to get 1 dropdown working fine.
I am curious to know if there is a best practice way off accomplishing this with multiple dropdowns/queries.
Is it better to merge multiple queries into one array? Is there a way to access the individual returns from my controller?
getInfo();
function getInfo(){
// Sending request to EmpDetails.php files
$http.post('databaseFiles/options.php').success(function(result){
// Stored the returned data into scope
$scope.options = result;
console.log(result);
});
}
<select class="form-control" ng-model="selectedDepartment"
ng-options="option.id as option.department for option in options ">
<option value="">Select Department</option>
</select>