I am encountering an issue with an empty option when cycling through an array. Below is the code snippet.
View:
<select ng-model="getseason" class="form-control">
<option ng-repeat="season in seasons" value="{{ season }}">
Season {{ season + '/' + seasonaddone(season) }}
</option>
</select>
Model:
$scope.getseason={};
$scope.seasons = [2014,2013,2012,2011,2010,2009,2008,2007,2006,2005];
$scope.getseason = $scope.seasons[0];
$scope.seasonaddone = function(season){
return ++season;
}
$scope.$watch('getseason',function(){
console.log($scope.getseason);
console.log(typeof $scope.getseason);
});
Is there a way to eliminate the empty option? I have come across similar issues online, however, I haven't been able to find a solution for this specific problem.