我使用Angularjs日历UI创建事件调度程序日历。最初,日历是隐藏的,并在开关切换它显示。但直到按下“下一个月”或“上一个月”按钮,日历才会呈现。
app.controller('toggleController', [ '$scope', function($scope) {
$scope.toggleSelection = function toggleSelection(event) {
angular.element(document.querySelectorAll('.calendar-container')).css({display:'block'});
};
}]);
所以我想从日历ui控制器调用render函数,以便在从上面的控制器切换视图时进行渲染
app.controller('CalendarCtrl', ['$scope','$rootScope', function($scope, $compile, $timeout, uiCalendarConfig) {
$scope.renderCalendar = function(calendar) {
$timeout(function() {
if(uiCalendarConfig.calendars[calendar]){
uiCalendarConfig.calendars[calendar].fullCalendar('render');
}
});
};
}]);
我尝试使用调用renderCalendar函数
$rootscope
$timeout not defined
或
uiCalendarConfig not defined
等