I have controller like
$scope.operationData = [
{
"label" : "Inventory",
"labelType" : "Master Tables",
"type" : "PROCESSOR",
"outputStreams" : 1,
"elementType" : "TABLE",
"name" : "Inventory",
"columns": [
{
"columnName": "InvoiceName",
"dataType": "varchar",
"label": "Invoice Name",
"required": false,
"keyType":"PK"
},
{
"columnName": "InvoiceDate",
"dataType": "varchar",
"label": "Invoice Date",
"required": false
}
]
},{
"label" : "Order",
"labelType" : "OutPut Tables",
"type" : "PROCESSOR",
"outputStreams" : 1,
"elementType" : "TABLE",
"name" : "Order",
"columns": [
{
"columnName": "OrderName",
"dataType": "varchar",
"label": "Order Name",
"required": false
},
{
"columnName": "OrderDate",
"dataType": "varchar",
"label": "Order Date",
"required": false
}
]
},
{
"label" : "Purchase Order Details",
"labelType" : "OutPut Tables",
"type" : "PROCESSOR",
"outputStreams" : 1,
"elementType" : "TABLE",
"name" : "Purchase Order Details",
"columns": [
{
"columnName": "PurchaseOrderName",
"dataType": "varchar",
"label": "Purchase Order Name",
"required": false,
"keyType":"PK"
},
{
"columnName": "PurchaseOrderDate",
"dataType": "varchar",
"label": "Purchase Order Date",
"required": false
}
]
}];
my view is
<select class="form-control col-lg-2" ng-model="sourceTable"
ng-options="tabelName.label for tabelName in operationData"
ng-change="getOperationColumns(sourceTable)">
<option value=""> Source Tables</option>
</select>
<select class="form-control col-lg-2" ng-model="sourceColumn"
ng-options="column in operationColumn">
<option value="">Source Columns</option>
</select>
Here I attached jsfiddle link http://jsfiddle.net/soumyagangamwar/pno7xojh/1/
my requirement is when I select sourcetables I have to show only that columns in source column drop down I am using ng-change function but not getting the functionality.
Example If I select label-Inventory
I want InvoiceName,InvoiceDate in sourcecolumns drop down,
If I select label-Order I want OrderName,OrderDate in source columns
Please help me to do that.