Have you looked at AngularUI ? Then you can use jQuery pass-through without creating your own directive (I also added ui-options as an example if you decide to use it). Here's what it looks like:
<input class="payment_date" ui-jq="datepicker" ui-options="{dateFormat:'dd-mm-yy'}" placeholder="Payment Date" type="text" ng-model="payment.date" />
Regarding the placement of the identifier on it, I'm not sure why you need it. If you want to get the value of the selected date, instead:
var myDate = $("#"+myIndex).val();
You must do this:
var myDate = invoice.payment[myIndex].date;
This is the beauty of angular, you do not need to use the DOM here. Let me know if you have any questions and I will be happy to answer them.
source share