Working example of AngularJS and Bootstrap DatePicker directive?
angularjs, javascript, twitter-bootstrap
Solution
please see this directive, a working calendar fiddle: http://jsfiddle.net/nabeezy/HB7LU/209/
myApp.directive('calendar', function () {
return {
require: 'ngModel',
link: function (scope, el, attr, ngModel) {
$(el).datepicker({
dateFormat: 'yy-mm-dd',
onSelect: function (dateText) {
scope.$apply(function () {
ngModel.$setViewValue(dateText);
});
}
});
}
};
})
Problem
I've seen a variety of github directive examples, but none include a working JSFiddle and I've not been able to get any of them to work. Surprised this isn't in Angular-UI by this point.