I am using Full Calendar plugin for Angular 11. I keep getting the error "Cannot read property '__k' of null". Seems it is happening when calendar.render() is called. But can't get to the bottom of it. Any help is much appreciated.
This is my ts 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 my html file
<div class="calendar">
<full-calendar #calendar [options]="calendarOptions"></full-calendar>
</div>
