来自数据库的Angular JS下拉列表

时间:2018-08-05 15:28:49

标签: angularjs angular-ui-bootstrap

<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}来自控制器。无法从下拉列表中捕获选定的值。在此先感谢

0 个答案:

没有答案