My current setup includes the following versions:
- jQuery: 3.3.1
- jQuery UI: 1.12.1
- AngularJS: 6
Here's a snippet of my code:
<input id="test" type="text" class="form-control" value="">
In my component (component.ts file), I have the following code in the ngOnInit function:
$('#test').datepicker({
changeMonth: true,
changeYear: true,
yearRange: "1930:2010"
});
When initially loading the page, the datepicker works fine. However, after navigating away and returning to the page, it no longer pops up.
Upon inspecting the elements in the browser, I noticed that the dynamic <div> element is not being created:
<div id="ui-datepicker-div" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all" style="position: absolute; top: 0px; left: 732.078px; z-index: 1; display: block;">
I am unsure where I may have gone wrong with this implementation. Any assistance would be greatly appreciated!