Code: Select all
<p-calendar #calendar></p-calendar>
<p-button label="Open Calendar" (click)="openCalendar()"></p-button>
Code: Select all
export class AppComponent {
@ViewChild('calendar') calendar: Calendar
openCalendar() {
// I tried each of these Individually
this.calendar.showOverlay()
this.calendar.inputfieldViewChild.nativeElement.dispatchEvent(new Event('focus'))
this.calendar.inputfieldViewChild.nativeElement.dispatchEvent(new Event('click'))
}
}