Open sagar-ganatra opened 10 years ago
I'm interested in this issue too.. any ideas?
I was able to fix this issue, in the 'eventSource' object mention 'events' property:
$scope.eventSource = { events: function (param1, param2) { contactCalendarService.getContactCalendar(param1, param2) .then(function (response) { //process response here }); } };
Mmh I'm not sure to understand your solution! How does this code help to get angular mock working with fullcalendar?
In the template I have the following code:
<div ui-calendar="uiConfig.calendar" ng-model="appointments" id="allAppointments"></div>
In the controller I configure a viewRender callback
$scope.uiConfig = calendar:
viewRender: $scope.getAppointments
and have the following function to get the data
$scope.getAppointments = (view, element) ->
restAppointments = Restangular.all('appointments')
restAppointments.getList({start: view.start.format(), end: view.end.format()}).then(
(appointments) ->
$scope.remoteAppointments = appointments
$scope.appointments.length = 0
$scope.appointments.push $scope.remoteAppointments
)
In this particular case I am using Restangular but I am planning to replace it with plain $http
The _fetchEventSource method uses $.ajax to send a request. When working on an application where the data is served from Angular mock ($httpBackend), the request does not get served by the mock server. Is there any workaround to this?
If fullcalendar.js can use $http instead of $.ajax from jquery, requests would get served correctly.