Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2014
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. <select class="date-input" ng-model="reservation.date">
  2. <option ng-repeat="d in dates track by $index"
  3. value="{{ d }}"
  4. > {{ d }} </option>
  5. </select>
  6.  
  7. $scope.makeDates = (function () {
  8. dArray =[];
  9. // we make a big array of dates ['dd-mm-yyyy','dd-mm-yyyy', 'dd-mm-yyyy'...] for 3 months and return it
  10. return dArray;
  11. }();
  12.  
  13. $scope.reservation = {
  14. date : null,
  15. time : null,
  16. quantity : null
  17. };
  18. $scope.dates = $scope.makeDates;
  19. $scope.reservation.date = $scope.dates[0];
  20.  
  21. <div ng-app='myApp' ng-controller="ArrayController">
  22. <select class="date-input" ng-model="reservation.date">
  23. <option ng-repeat="d in dates track by $index">{{d}}</option>
  24. </select>
  25. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement