0
在這裏,我想結合在十年下拉年從角碼讀取,但爲什麼它不綁定在下拉列表如何綁定在下拉值
<div ng-controller="Supercntrl">
<div>
<select class="form-control" ng-model="YearList">
<option ng-repeat="Bin in BindYears" value="{{Bin.YearList}}">{{Bin.YearList}}</option>
</select>
</div>
Angular.jS
angular.module('MyApp',[])
.controller('Supercntrl',function($scope){
BindYears();
function BindYears() {
$scope.YearList = [];
int: 1991;
for (var Y = 1991; Y <= 1995; Y++) {
$scope.YearList.push(Y);
}
}
我怎樣才能顯示,請選擇年份 –