I am able to populate 2 dropdowns directly from database. My problem is, the 2nd dropdown values has to be populated based on the 1st dropdown selection. Since i am new to
I implemented like following, Hope it helps :)
Controller code
var app = angular.module("app",[]);
app.controller("ctrl",function($scope){
$scope.key_options = [
{table:"Table_1",key:"age_flg",key_label:"Age"},
{table:"Table_1",key:"ethnicity_flg",key_label:"Ethnicity"},
{table:"Table_2",tab_label:"Table 2",key:"green_flg",key_label:"Green Flag"},
{table:"Table_2",tab_label:"Table 2",key:"life_flg",key_label:"Life Flag"}
];
$scope.options = [
{table:"Table_1",tab_label:"Table 1"},
{table:"Table_2",tab_label:"Table 2"}
];
$scope.sel = function(){
if($scope.key_attr){
console.log($scope.sel_attr['table']);
console.log($scope.key_attr['key']);
};
}
});
html code: