0
Hello, I have an angular application where I am using jquery scripts to implement a datapiker and a timepiker, these presented below:
I have a separate script for their startup, presented below:
jQuery(document).ready(function () {
$('#datepicker, .datepicker').datepicker({ dateFormat: 'dd.mm.y' });
$('.select').styler();
$('input.timepicker').timepicker({ timeFormat: 'HH:00' });
$('.radio-list__input-wrap').mousedown(function () {
changeCheck($(this));
});
$('.radio-list__input-wrap').each(function () {
changeCheckStart($(this));
});
function changeCheck(el) {
var el = el, input = el.find('input').eq(0);
if (!input.attr('checked')) {
$('.radio-list__input-wrap').each(function () {
cInput = $(this).find('input').eq(0);
if (cInput.attr('name') == input.attr('name')) {
$(this).removeClass('radio-list__item_active');
cInput.attr("checked", false);
}
});
el.addClass('radio-list__item_active');
input.attr("checked", true);
}
return true;
}
function changeCheckStart(el) {
var el = el, input = el.find('input').eq(0);
if (input.attr('checked')) {
el.addClass('active');
}
return true;
}
});
However this screen is not my home screen, with this the datapiker and the timepiker is only presented if der F5 on this screen presents, so the script would load them.
I would like to know how to load this script as soon as this page is presented?
Thank you in advance
I recommend you use another date Picker library built pro angular.
– Eduardo Vargas
In the company where I work the scripts is already ready, I can not replace...
– Guilherme Nunes