我有一个过滤器
angular.module(Bt.config.site.ng_app_name)
.filter('range', function () {
return function (input, min, max, padding){
min = parseInt(min);
max = parseInt(max);
padding = padding ? padding : false;
for (var i=min; i<=max; i++){
input.push(padding ? ("00" + i).slice (-2) : i + '');
}
return input;
};
});
一个选择
<select ng-options="n for n in [] | range:1:31:true" name="day" value="{{contestant.day}}" ng-model="contestant.day">
<option value="">DD</option>
</select>
输出是
<select ng-model="contestant.day" value="" name="day" ng-options="n for n in [] | range:1:31:true" class="ng-pristine ng-valid">
<option value="" class="">DD</option>
<option value="0">01</option>
<option value="1">02</option>
<option value="2">03</option>
// and so on
</select>
它应该是
<select ng-model="contestant.day" value="" name="day" ng-options="n for n in [] | range:1:31:true" class="ng-pristine ng-valid">
<option value="" class="">DD</option>
<option value="01">01</option>
<option value="02">02</option>
<option value="03">03</option>
// and so on
</select>
提前致谢。