Good day. I'm playing around with an Angular 19 application which is taken straight from FullCalendar's GitHub repo. As expected, the initializeEvents from a hard-coded array in the demo works just fine. I need to populate the events, though, from a URL. I have tried converting the service call response to EventAPI, EventInput etc... but even though I can plainly see the service call response being constructed into an array, the calendar seems to be oblivious to it. If anyone can give me some guidance here, it would be greatly appreciated.
Here is my options object in my app-component:
export class AppComponent {
calendarVisible = signal(true);
calendarOptions = signal<CalendarOptions>({
plugins: [
interactionPlugin,
dayGridPlugin,
timeGridPlugin,
listPlugin,
],
headerToolbar: {
left: 'prev,next today',
center: 'title',
right: 'dayGridMonth,timeGridWeek,timeGridDay,listWeek'
},
initialView: 'dayGridMonth',
//initialEvents: INITIAL_EVENTS, // alternatively, use the `events` setting to fetch from a feed
weekends: true,
editable: true,
selectable: true,
selectMirror: true,
dayMaxEvents: true,
select: this.handleDateSelect.bind(this),
eventClick: this.handleEventClick.bind(this),
eventsSet: this.handleEvents.bind(this),
/* you can update a remote database when these fire:
eventAdd:
eventChange:
eventRemove:
*/
events: this.loadEvents.bind(this)
});
constructor(private changeDetector: ChangeDetectorRef) {
}
...
}