Wednesday, 7 August 2013

Why is the datepicker opening automatically?

Why is the datepicker opening automatically?

With the below code, my datepicker is always open and I don't see the
input area:
HTML:
<span><strong>End Date</strong></span>
<td ng-controller="notificationModalController">
<input type="text" name="notification.text"
ng-model="notification.text" datepicker="">
</td>
JS:
app.directive('datepicker', function () {
return {
require: 'ngModel',
link: function (scope, el, attr, ngModel) {
$(el).datepicker({
autoclose:true,
onSelect: function (dateText) {
scope.$apply(function () {
ngModel.$setViewValue(dateText);
});
}
});
}
};
});
I'm using this theme in case it matters:
http://wrapbootstrap.com/preview/WB0T41TX4
Why would the datepicker always be open? I'd like for it to behave like
the one in the theme sample but this is the closest I've gotten:

No comments:

Post a Comment