View the full calendar after viewing the Render

I have a problem here, I'm trying to load an event when the view changes using the synchronization point. Changing the synchronization point works fine, I can also send and receive information. But the calendar is still freezing, I have to change a few months before it starts working again. Then I can return to the previous month. I use AngularJS to load the event and $q to load the data before the request:

 $q(function(resolve, reject) { resolve(beforeSendStatus()); }).then(function() { EventService.get({ start: moment(start).format("DD-MM-YYYY"), end: moment(end).format("DD-MM-YYYY"), format: 'FC', onlyMe: false }).then(function(data) { $('.status').find('i').removeClass("fa-spin fa-circle-o-notch").addClass('fa-check'); //TODO trouver un autre moyen que le addEventSource, ca fait bugger le calendrier. Calendar.fullCalendar('renderEvents', data.data); console.log('revenue bouge esti'); eventLenghtCalc(view, 325); console.log('yes'); }, function(error) { $('.status').find('i').removeClass("fa-spin fa-circle-o-notch").addClass('fa-close').css({ 'color': 'red' }); toastr.error(error.data); }); }) 

If I delete the part with $q , it works well. Have any of you had problems with the async function in the viewRender callback?

Thank you, we have a great day!

ps. the beforeSendStatus() function only changes the icons for the counter.

+7
javascript jquery angularjs asynchronous fullcalendar
source share
2 answers

What is your Calendar object? is this https://fullcalendar.io/ ?

Be careful if you combined jquery code with angular; the mixture did not work well. Better add a global variable and use an ng class to update your call.

I suggest using the angular ui component, for example: http://angular-ui.imtqy.com/ui-calendar/

0
source share

First of all, I believe that you can use eventSources for several even sources.

If you still want to add events manually, use addEventSource .

Also for the bootloader you can use the fullCalendar loading callback.

0
source share

All Articles