Newbie in angular js - I am trying to add jQuery date picker to ng-model text box. Here are the links of jQuery date picker:
src="https://resources.ibe4all.com/BrokerAssist/js/BuroRaDer_DateRangePicker.js" type="text/javascript"></script><script type="text/javascript" src="https://resources.ibe4all.com/CommonIBE/js/jquery-1.4.1.js"></script<script type="text/javascript" src="https://resources.ibe4all.com/CommonIBE/js/jquery-ui-1.8.11.custom.min.js">
<link href="https://resources.ibe4all.com/BrokerAssist/cssnew/BuroRaDer.DateRangePicker.css" rel="stylesheet" />
jQuery date picker code:
<script>
$(document).ready(function () {
$('#RDate').datepicker({
dateFormat: 'dd/mm/yy',
changeMonth: true,
changeYear: true
});
//$("#RDate").click(function () {
// $(this).focus();
//});
});
function AvoidSpace(event) {
var k = event ? event.which : window.event.keyCode;
if (k == 32) return false;
}
</script>
This is my HTML markup:
<body style="background-image: url(/Content/images/img_bg_2.jpg);"
ng-app="nmodule" ng-controller="ncontroller">
<form name="userForm" novalidate="novalidate">
<ng-form name="userForm" ng-submit="submitForm(userForm.$valid)">
<input type="text" name="RDate" ng-model="RDate" id="RDate"
placeholder="Enter Registration Date" required />
{{RDate}}
</ng-form>
</form>
</body>
Date picker is working like a charm but, the problem I am facing is that the date is not binding with my angular model and I am not able to get date in $scope plus my validations are not working on the textbox because it is not considering date as input through date picker.
Please help me with a working plunker