【发布时间】:2017-07-26 04:09:52
【问题描述】:
我正在使用 Angularjs 日历 UI 来创建事件调度程序日历。最初日历是隐藏的,在切换开关时它会显示出来。但是在按下下个月或上个月按钮之前不会呈现日历。
app.controller('toggleController', [ '$scope', function($scope) {
$scope.toggleSelection = function toggleSelection(event) {
angular.element(document.querySelectorAll('.calendar-container')).css({display:'block'});
};
}]);
所以我想从日历 ui 控制器调用渲染函数,以便在上面控制器的切换视图上渲染它
app.controller('CalendarCtrl', ['$scope','$rootScope', function($scope, $compile, $timeout, uiCalendarConfig) {
/* Change View */
$scope.renderCalendar = function(calendar) {
$timeout(function() {
if(uiCalendarConfig.calendars[calendar]){
uiCalendarConfig.calendars[calendar].fullCalendar('render');
}
});
};
}]);
我尝试使用 $rootscope 调用 renderCalendar 函数,但出现以下错误
$timeout not defined或uiCalendarConfig not defined等
【问题讨论】:
标签: angularjs fullcalendar fullcalendar-scheduler ui-calendar