在事件拖放之后,AngularJS UI 日历不会更新 $scope.eventSources 数据模型。我需要获取更新的模型,但没有任何效果。
我已经尝试了很多东西,没有任何效果。.
这是我的代码:
/* config object */
$scope.uiConfig = {
calendar:{
height: 600,
editable: true,
header:{
left: 'month basicWeek basicDay agendaWeek agendaDay',
center: 'title',
right: 'today prev,next'
},
eventClick: $scope.alertEventOnClick,
eventDrop: $scope.alertOnDrop,
eventResize: $scope.alertOnResize,
eventRender: function (event, element) {
if (event.HighPriority == 1) {
event.className ='highPriority';
}
}
}
};
/* load events source that contains custom events on the scope */
$scope.events = agendaFactoryLocalStorage.getAgenda();
$scope.eventSources = [$scope.events];
$scope.alertOnDrop = function(event, delta, revertFunc, jsEvent, ui, view){
$scope.alertMessage = ('Event Droped to make dayDelta ' + delta);
uiCalendarConfig.calendars.exampleCalendar.fullCalendar('removeEvents');
uiCalendarConfig.calendars.myCalendar.fullCalendar('refetchEvents');
});
$scope.save_agenda = function(){
agendaFactoryLocalStorage.updateAgenda($scope.eventSources);
}
$scope.save_agenda 仍然发送相同的数据模型,虽然我已经拖放了 1 个事件,但我真的不知道该怎么做,卡住了 3 个小时。$scope.eventSources 加载正确,但是,拖放不会改变模型,只有“事件”变量被更新,但它是独一无二的,我试图将它推入 $scope.eventSources 没有运气