我正在尝试使用ng-change从选择列表中获取用户选择的值,但我似乎找不到出问题的地方:
这是html:
<body ng-app="myApp" ng-controller="myCtrl">
<div>
<p> Employee Name/Employee ID:
<select ng-model="pickEmp" ng-change="setEmployee(pickEmp)">
<option ng-value="James">James</option>
<option ng-value="Sam">Sam</option>
<option ng-value="Patrick">Patrick</option>
</select>
</p>
</div>
</body>
这是JS
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope,$http) {
$scope.formObject = {
empId:'Sam',
que1:{
status:'YES',
payBand:0-11
}
$scope.setEmployee = function(){
$scope.pickEmp = $scope.formObject.empId;
}
答案 0 :(得分:0)
在Private Sub Worksheet_Change(ByVal Target As Range)
MsgBox "Number of cells changed: " & Target.Cells.Count & vbLf & _
"Changed cell(s): " & Target.Address & vbLf & _
"Cell value changed to: " & _
IIf(Target.Cells.Count > 1, "(Multiple values)", Target)
End Sub
函数中,您将ng-model设置为值setEmployee
。删除该行。
sam
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope,$http) {
$scope.formObject = {
empId:'Sam',
que1:{
status:'YES',
payBand:0-11
}}
$scope.setEmployee = function(){
console.log($scope.pickEmp)
}
})