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.
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
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" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With