<script>
var app = angular.module('test', []);
app.controller('langCtrl', function($scope) {
$scope.switchLanguage = function() {
$scope.calculatedValue = 'You selected number ' + $scope.selected;
console.log($scope.calculatedValue);
}
});
</script>
</head>
<div ng-app='test'>
<label>Please select number:</label> <select ng-model="selected" ng-controller="langCtrl"
ng-change="switchLanguage()">
<c:forEach items="${listString}" var="child">
<option value="">${child}</option>
</c:forEach>
</select>
<button type="button" class="btn btn-success active">View
Details</button>
这是什么问题? $ {listString}来自控制器。无法从下拉列表中捕获选定的值。在此先感谢