angular-ui / ui-calendar

A complete AngularJS directive for the Arshaw FullCalendar.
http://angular-ui.github.io/ui-calendar/
MIT License
1.49k stars 729 forks source link

events are not rendering properly after refresh. #519

Closed chaluvadis closed 6 years ago

chaluvadis commented 6 years ago

Hello, I am facing one strange issue,

image events are not rendering after the page refresh.

I will try to explain the problem.

When my calendar controller is loaded, i am a calling a method to get the data from the server side and preparing the events objects and binding to the eventSource property. at this time the calendar is rendering with valid data.

When I am trying to refresh the page or hitting the url directly from browser, the calendar controller is making a call to the server and getting the data but in the client side the calendar is not showing the data, when i check the dom the configuration is also rendered properly, but the events sections is not rendering.

Main method in calendarControllerMethod.

` function returnCalendarConfig() { return { calendar: { height: 500, editable: false, displayEventTime: true, selectable: true, timeFormat: 'hh:mm A', stick: true, defaultView: 'month', columnFormat: 'dddd', disableDragging: false, header: { left: 'month,agendaWeek,agendaDay', center: 'title', right: 'prev,next' }, eventClick: $scope.onEventClick, dayClick: $scope.onDayClick, eventRender: $scope.onEventRender } }; }

function getCalendarEvents() { calendarFactory.eventsGet(params, body, additionalParams) .then(function (result) { if (!result.error) { $scope.uiConfig = returnCalendarConfig(); angular.forEach(result.data, function (item) { $scope.events.push(mapDataToEventFromat(item)); }); applyScope(); } else { } // $scope.myCalendar.fullCalendar("refetchEvents"); }) }

getCalendarEvents()`

HTML Markup

`

            </div>`

Any help appriciated.

Pablodotnet commented 6 years ago

How did you solved it? My calendars aren't showing after refreshing page too..