Skip to content

Instantly share code, notes, and snippets.

@adrianvlupu
Last active August 29, 2015 14:02
Show Gist options
  • Save adrianvlupu/e62868cc837da05c747c to your computer and use it in GitHub Desktop.
Save adrianvlupu/e62868cc837da05c747c to your computer and use it in GitHub Desktop.
Basic jquery plugin angular wrapper
/// <reference path="../../_references.js" />
//super adaptare de jquery plugin
mainModule.directive('datePicker', function () {
return {
restrict: 'A',
scope:{
bindModel: '=ngModel'
},
link: function ($scope, $elem, $attrs) {
$elem.datepicker({
inline: true,
dateFormat: 'dd.mm.yy',
onSelect: function (dateText, inst) {
$scope.bindModel = dateText;
$scope.$apply();
}
});
}
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment