在下面的条件下,我无法获得选定的值,但我没有使用指令 ng-show 我能够获得ng-model值。
特别是我无法获得选择框的$ scope.SCENTER_NAME的价值。
<div class="row">
<div class="col-lg-12">
<div class="row">
<div class="col-lg-6" ng-show="mode==1">
<h6><strong>LEGAL ENTITY:</strong>
<select id="LEntity_updated" ng-model="SCENTER_NAME" ng-options="cntr.CENTER_NAME for cntr in myCenter track by cntr.CENTER_ID" class="form-control">
</select></h6>
</div>
<div class="col-lg-6">
<h6><strong>SBU:</strong><select id="updatedPrgm" ng-model="SelectedPRGM_NAME" ng-options="prgm.PROGRAM_NAME for prgm in myPrgm track by prgm.PRGM_ID" class="form-control"></select>
</h6>
</div>
</div>
</div>
<div class="col-lg-12">
<div class="row">
<div class="col-lg-6">
<h6><strong>Department:</strong>
<select id="Department_updated" ng-model="selectedDep" ng-change="OnDeptChange()" ng-options="cntr.Dept_name for cntr in myDepartment" class="form-control" required></select></h6>
</div>
<div class="col-lg-6">
<h6><strong>Sub Department:</strong>
<select id="subdept_updated" ng-disabled="mysubDepartment.length == 0" ng-model="SelectedSub_Dept_Name" ng-options="cntr.Sub_Dept_Name for cntr in mysubDepartment" class="form-control" required></select></h6>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" ng-click="Send_data(mode,selectedtxid)">Approved</button>
</div>
$scope.Send_data= function (mode, selectedtxid) {
var postData = {
pg: $scope.SelectedPRGM_NAME,
pcent: $scope.SCENTER_NAME, // unable to get the value here.
dpt: $scope.selectedDep,
subdept: $scope.SelectedSub_Dept_Name,
rmemp: $scope.selectedEmployee_mgr.originalObject,
req: $scope.selectedEmployee,
modee: mode,
SelectedDsbu: $scope.SelectedDsbu,
selectedtxid: selectedtxid,
selectedReporties: $scope.reporties
};
}
让我知道我做了任何错误或需要更改代码。