Skip to content

Instantly share code, notes, and snippets.

@wezoalves
Created July 5, 2013 21:18
Show Gist options
  • Save wezoalves/5937314 to your computer and use it in GitHub Desktop.
Save wezoalves/5937314 to your computer and use it in GitHub Desktop.
<script type="text/javascript" src="js/bootstrap-datepicker.js"></script>
<div id="datepicker"></div>
<script type="text/javascript">
$('#datepicker').datepicker().on('changeDate', function(ev){
var element = angular.element($('#datepicker'));
var controller = element.controller();
var scope = element.scope();
scope.$apply(function(){
scope.doSomethingWithDate(ev.date);
});
});
</script>
And then in your controller.js:
<script type="text/javascript">
$scope.doSomethingWithDate = function (date){
alert(date);
};
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment