Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <select class="date-input" ng-model="reservation.date">
- <option ng-repeat="d in dates track by $index"
- value="{{ d }}"
- > {{ d }} </option>
- </select>
- $scope.makeDates = (function () {
- dArray =[];
- // we make a big array of dates ['dd-mm-yyyy','dd-mm-yyyy', 'dd-mm-yyyy'...] for 3 months and return it
- return dArray;
- }();
- $scope.reservation = {
- date : null,
- time : null,
- quantity : null
- };
- $scope.dates = $scope.makeDates;
- $scope.reservation.date = $scope.dates[0];
- <div ng-app='myApp' ng-controller="ArrayController">
- <select class="date-input" ng-model="reservation.date">
- <option ng-repeat="d in dates track by $index">{{d}}</option>
- </select>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement