【发布时间】:2014-10-29 05:33:34
【问题描述】:
我在选择 ng-options 中插入值,我想在下拉列表中选择特定月份。 这是返回所有 12 个月的数组,所以我怎样才能从下拉列表中只获取选定的月份。
脚本:
$scope.Month = ['Jan', 'Feb', 'March', 'April', 'May', 'June', 'July', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
$scope.selectmonth = $scope.Month;
$scope.SaveReport = function () {
PrintReportRepository.save(
{
SelectMonth: $scope.selectmonth,
},
html
<select class="form-control" ng-model="selectmonth" ng-options ="months as months for months in Month">{{months}}</select>
【问题讨论】:
标签: javascript c# angularjs