How to make PrimeNG calendar at open state by default in modal popup ? Or how to trigger click event to open PrimeNG calendar which is in modal popup by typescript ?
If I used in HTML itself, it triggers the click event to open calendar by showoverlay(), but when using in modal popup, since popup is not in DOM element, it shows error as showoverlay() is not a function.
First, add a
Viewchildto your calendar so that you can manipulate it to open it programmatically.Then, inside your method which opens the popup, call the
showOverlaymethod on your calendar object to open it.Finally, surround this last line of code with a
setTimoutto delay its call.HTML
Ts
See StackBlitz