【发布时间】:2016-08-17 07:25:30
【问题描述】:
我在我的 HTML 页面中创建列表:
<label class="item item-input">
<span class="input-label">Select date</span>
<select ng-model="search.dateOption" ng-options="opt as opt.label for opt in options">
</select>
</label>
在我的控制器中,我定义了选项:
$scope.options = [
{ label: 'Today'},
{ label: 'This week'},
{ label: 'This month'},
{ label:'Other'}
]
我使用以下函数来获取所选项目:
$scope.selectedDate = function(){
$scope.search={}
console.log($scope.search )
}
我在控制台中收到undefined。
【问题讨论】: