我的问题是,当我打开页面时,事件会通过回调 (function().then) 加载,这会导致我的日历无法加载 $scope.eventSources 中传递的事件
看法
<div id="calendar" ui-calendar="uiConfig.calendar" calendar="myCalendar1" class="calendar" ng-model="eventSources"></div>
控制器
function LogisticaCtrl($scope, LogisticaService, $stateParams, $state, uiCalendarConfig) {
/* Event sources array */
$scope.eventSources = {};
/* config object */
$scope.uiConfig = {
calendar:{
editable: true,
header: {
left: 'prev,next',
center: 'title',
right: 'month'
}
}
};
$scope.getLogistica = function(usu_seqreg) {
LogisticaService.GetLogistica(usu_seqreg)
.then(function (logistica) {
$scope.logistica = logistica;
$scope.eventSources = logistica.events;
});
};
$scope.getLogistica($stateParams.usu_seqreg);
}
Angular 版本: 1.5
Fullcalendar 版本: v2.1.1
ui-calendar 版本:未知,但看起来像1.0.0(我比较了JS)
之后可以加载事件吗?我尝试了一些技巧,但没有成功。我得到的最接近的是控制器中的另一个函数,它破坏了日历并用完整的 javascript 重新创建它。但是,即使在这种情况下,我也需要使用页面中的按钮来执行此功能。