I can't seem to make that blank option disappear. Any recommendation on how to do it? AngularJS is not giving me any helpful information and I tried to apply a lot of suggestions from Stackoverflow.
angular.module("myApp", []);
angular.module("myApp").component("app", {
template: `
<div>
<select
ng-model="$ctrl.foo"
ng-options="day.value as day.label for day in $ctrl.days track by day.value"
></select>
</div>
`,
controller: function() {
this.days = _.range(0, 31).map(function(day) {
if (day === 0) return {label: "No Wait", value: day};
return {label: "" + day, value: day};
});
this.foo = 2;
}
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.4/lodash.min.js"></script>
<script src="https://code.angularjs.org/1.6.5/angular.js"></script>
<body ng-app="myApp">
<app></app>
</body>