I'm creating a datepicker directive, part of its markup is:
<select class="form-control" ng-model="day" ng-options="day.nr for day in allDays">
I'm trying to define allDays in the scope attribute like this:
ehrApp.directive('datePicker', function() {
return {
scope: {
allDays: [
{'nr': 1},
{'nr': 2},
{'nr': 3},
(...)
{'nr': 31}
]
},
But it doesn't work, it fails with "TypeError: undefined is not a function".
Any ideas how to achieve this?