I'm currently working on integrating FullCalendar into an Angular 1 project, and I have successfully displayed events. However, I encountered an issue when trying to add events on next and previous button clicks. Despite receiving a response from the server, the events assigned to FullCalendar revert back to the default view (e.g., agenda). Below is the code snippet for better understanding:
HTML
<div id="demoCalender" fc fc-options="calendarOptions">
Angular
$scope.defaultViewAgenda = "agendaDay";
$scope.calendarOptions = {
// Calendar options here
};
// Function to get rescheduled agenda events
$scope.getAgendaReschedules = function(agenda, startTime, endTime, isAgendaNextOrPrevious) {
// Get agenda reschedules logic here
};
// Event listeners for previous and next button clicks
$('#demoCalender').fullCalendar().on('click', '.fc-prev-button', function() {
// Previous button click logic
});
$('#demoCalender').fullCalendar().on('click', '.fc-next-button', function() {
// Next button click logic
});
// Functions to handle previous and next agenda reschedules
$scope.getPreviousAgendaReschedules = function(agendaStartCharacterToSubtract) {
// Logic for getting previous agenda reschedules
};
$scope.getNextAgendaReschedules = function(agendaStartCharacterToAdd) {
// Logic for getting next agenda reschedules
};
If anyone can help figure this out, it would be greatly appreciated!