I have a date picker widget, and I want to pass the picked date to the controller. I have this script snippet in my view:
<div id="datepicker"></div>
<script type="text/javascript">
$('#datepicker').datepicker();
$('#datepicker').datepicker()
.on('changeDate', function(ev){
alert(ev.date);
});
</script>
How to send this "ev.date" to the controller?
I want it to affect controller variable so this change is then picked up by a directive and dom is modified in the directive.