agusluc
agusluc

Reputation: 1465

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.

Upvotes: 5

Views: 42908

Answers (2)

Mahesh
Mahesh

Reputation: 3997

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" />

Upvotes: 2

pherris
pherris

Reputation: 17693

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

Upvotes: 10

Related Questions