I am working on an angular2 application with a Full Calendar component. I am trying to show a dialog when a full calendar event is clicked using the eventClick
callback. Below is the relevant code snippet:
export class ScheduleComponent implements OnInit{
events: CalendarEvent[];
display: boolean;
tables: SelectItem[];
selectedTable: string;
ngOnInit(){
this.display = false;
this.scheduleService.GetAllEvents().subscribe((data: CalendarEvent[]) =>
{
this.events = data;
var calendar: JQuery = $("#calendar");
(<any>calendar).fullCalendar({
eventClick: function(event) {
this.display = true;
return false;
}
});
});
}
}
This is a simplified version but includes all necessary details.
The issue I am facing is that the line this.display = true
within the eventClick
callback does not recognize the display
property.
Does anyone have insight into why this is happening and how it can be resolved?
Thank you,