Closed zflopez closed 7 years ago
hmm that's some strange behavior, have you tried taking a look at using eventSources ? http://fullcalendar.io/docs/event_data/Event_Source_Object/
i have the same problem! i think that there need use http://fullcalendar.io/docs/event_data/events_json_feed/#options sending URL of json and load all time the events
url: '/myfeed.php',
Sorry for the delay! I think I solved the problem by putting eventSources inside $http call to my JSON! Like this:
$scope.events = [];
$http.get("json/map_data.json").success(function(data) { $scope.locations = data; $scope.events.splice(0);
data.forEach(function(object) {
if(object.hasOwnProperty("events")) {
object.events.forEach(function(item) {
$scope.events.push(item);
})
}
})
/* event sources array*/
$scope.eventSources = [$scope.events];
});
Thank you very much for commenting!
glad you managed to fix this yourself ^.^, and thanks for leaving a comment on how you did it :].
Hi everyone!
I'm working with a JSON file to extract objects with dates to put them on a calendar, but there's some issue with those objects I'm pushing to $scope.events array. Because of this, every time I change to the next the month view, there's no events on the calendar at all, and if I return to the previous month, it's all gone.
` $scope.events = [];
$scope.eventSources = [$scope.events];
Thank you so much in advance!