Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ui-bootstrap Datepicker not working

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.

like image 625
agusluc Avatar asked Mar 05 '14 14:03

agusluc


2 Answers

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

like image 178
pherris Avatar answered Nov 01 '22 23:11

pherris


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" />
like image 44
Mahesh Avatar answered Nov 02 '22 01:11

Mahesh