I am trying to create a dynamic dropdown of this year and the next 3 years that will update automatically as the year changes. I am getting an unexpected token error from this attempt:
CONTROLLER:
$scope.thisYear = new Date().getFullYear();
$scope.year_span = [
{'id'=>$scope.thisYear, 'year'=>$scope.thisYear},
{'id'=>$scope.thisYear+1, 'year'=>$scope.thisYear+1},
{'id'=>$scope.thisYear+2, 'year'=>$scope.thisYear+2},
{'id'=>$scope.thisYear+3, 'year'=>$scope.thisYear+3}
];
HTML:
<div class="form-group col-md-4">
<label>Crop Year:</label>
<select name="crop_year" ng-model="frmData.loan.crop_year" class="form-control" ng-options="ys.id as ys.year for ys in year_span">
<option value="">Please select ...</option>
</select>
</div>