I am starting with AngularJs.
I need to implement "N" Calendars in a form. I am using bootstrap-datepicker (https://eonasdan.github.io/bootstrap-datetimepicker/)
It is working fine if I specify the inputTextId for example
Html:
<input id='datetimepicker2' data-ng-model="vm.search.origin.from" data-ng-click="vm.showCalendar(this)" class="form-control" type="text" placeholder="MM/DD HH:MM">
<input data-ng-model="vm.search.origin.to" data-ng-click="vm.showCalendar(this)" class="form-control" type="text" placeholder="MM/DD HH:MM">
Controller:
function showCalendar(obj)
{
$("#datetimepicker2").datetimepicker();
}
It works fine for one inputText, and if I want to implement it in more than one I have to specify every name and function. I want to pass the reference and use:
reference.datepicker(); or something like that in order to create just one function. Is that possible?