UI日历-如何刷新日历

时间:2019-07-11 00:56:00

标签: angularjs fullcalendar ui-calendar

我具有一个在每个事件操作上刷新日历的功能,我这样做的原因是当我创建或更新事件时,它会显示两次,直到刷新页面为止。

function clearCalendar(){
    if(uiCalendarConfig.calendars['vendorCalendar'] != null){
        uiCalendarConfig.calendars['vendorCalendar'].fullcalendar('removeEvents')
        uiCalendarConfig.calendars['vendorCalendar'].fullcalendar('unselect')
    }
}

$scope.populate = function(){
    clearCalendar()

    $http.get(urlEvents, {

      cache: false,
      params: {}

    }).then(function(response){
      $scope.vendorEvents = response.data.data
      $scope.vendorEvents.slice(0, $scope.vendorEvents.length)
      $scope.eventSources.push(response.data.data)
    })
}
<div class="vendor-calendar" ng-model="eventSources"
     calendar="vendorCalendar" ui-calendar="uiConfig.calendar">
</div>

函数执行时出现此错误:

  

uiCalendarConfig.calendars.vendorCalendar.fullcalendar不是函数

所有需要的库都导入了我的应用程序

0 个答案:

没有答案