Closed zellb closed 5 years ago
That's because that method has been removed in v4 of Fullcalendar. If you look at this page: https://fullcalendar.io/docs/v4/release-notes it clearly states that:
removeEventSources | Removed. Instead, use multiple EventSource::remove calls. Group together for performance with batchRendering.
So you should fetch all events that the calendar currently has in memory, and then call remove on each of them. Once that's done, you can add new events using the addEvent
method on fullcalendar.
Try something like this as a work-around until this component deals with this automatically:
@ViewChild('theCalendar') theCalendar: FullCalendarComponent; let allevents = this.theCalendar.calendar.getEvents(); allevents.forEach(el => { el.remove(); }); events.forEach(el => { this.theCalendar.calendar.addEvent(el); });
Fixed in v5.0.0-alpha.1
@martinsiden please check https://github.com/StickNitro/ngx-fullcalendar/issues/21
When trying to add new event or remove a current event from calendar using array's push or splice method Im getting the following error:
Steps to reproduce the behavior: