ui-bootstrap Datepicker not working
42,698
Solution 1
I'm not sure this will get you all the way to your objective, but I think the hurdle you are facing is that you forgot to import ui.bootstrap when creating your 'foo' app.
http://plnkr.co/edit/ZGl0VuJjVF1nliMidaL6
Solution 2
Ensure you have the is-open attribute defined in the markup.
<input type="text" class="form-control" datepicker-popup="date.format" ng-model="date.selectedDate" max-date="date.maxDate" datepicker-options="date.dateOptions" date-disabled="date.disabled(date, mode)" ng-required="true" close-text="Close" show-weeks="false" is-open="date.opened" ng-focus="date.opened=true" />
Comments
-
agusluc over 3 years
I'm trying to create a directive for the datepicker, but the popup is not working (neither clicking in the textfield or the button)
Plunker: http://plnkr.co/edit/hUxQASblscbhFZFvWDyN
p.d: the idea is remove all datepicker code from the controller (cause the datepicker will be used in many controllers), so please don't suggest move the open and close function to the page controller.
-
agusluc about 10 yearsi updated my plunker with the import, but is not working. Yours is working, did u change something else?
-
pherris about 10 yearsthe only other thing that I can see missing in yours is the datepicker-popup from the input tag. "datepicker-popup (Default: 'yyyy-MM-dd') : The format for displayed dates."
-
agusluc about 10 yearsyes, it was the datepicker-popup (strange, is not needed if u use the datepicker in the "standar" way). Also found another problem, my controler was including a config module that is not defined (its a leftover of the original code in my project). Thx!
-
pherris about 10 yearsSure! This issue may be related to the issue discussed here: github.com/angular-ui/bootstrap/pull/1809