Skip to content

Instantly share code, notes, and snippets.

@kappa7194
Created September 28, 2012 14:09
Show Gist options
  • Save kappa7194/3800097 to your computer and use it in GitHub Desktop.
Save kappa7194/3800097 to your computer and use it in GitHub Desktop.
jQueryUI datepicker in AngularJS
angular.module("Poster", []).directive("datepicker", function () {
return function (scope, element, attributes) {
element.datepicker({
autoSize: true,
dateFormat: "dd MM yy",
onSelect: function (dateText) {
scope[$(this).attr("data-ng-model")] = dateText;
scope.$apply();
}
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment