Last active
August 29, 2015 14:02
-
-
Save adrianvlupu/e62868cc837da05c747c to your computer and use it in GitHub Desktop.
Basic jquery plugin angular wrapper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <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