I am currently utilizing the Full Calendar plugin with Angular 11 but have encountered an error message stating "Cannot read property '__k' of null". It appears to be occurring when the calendar.render() function is called, and I'm struggling to pinpoint the exact cause. Any assistance on this matter would be greatly appreciated.
Here's a snippet from my TypeScript file:
export class FullCalendarComponent {
public calendar: Calendar | undefined;
calendarEl: any;
calendarOptions: CalendarOptions = {
slotMinTime: '07:00:00',
slotMaxTime: '19:00:00',
slotDuration: '00:15:00',
height: 680,
events: [
this.currentEvents,
],
headerToolbar: {
start: 'today prev,next',
center: 'title',
right: 'dayGridMonth,timeGridWeek,timeGridDay,listWeek'
},
firstDay: 1,
initialView: 'timeGridWeek',
weekends: true,
editable: true,
selectable: true,
selectMirror: true,
dayMaxEvents: true,
select: this.handleDateSelect.bind(this),
eventClick: this.handleEventClick.bind(this),
allDaySlot: false,
}
ngOnInit(): void {
let calendarEl = document.getElementById('calendar');
let calendar = new Calendar(calendarEl!, this.calendarOptions);
calendar!.render();
}
And here is part of my HTML file:
<div class="calendar">
<full-calendar #calendar [options]="calendarOptions"></full-calendar>
</div>