I am trying to access the fullcalendar object in ui-calendar. The docs say that all I have to do is give the calendar attribute a name:
<div ui-calendar="calendarOptions" ng-model="eventSources" calendar="myCalendar">
Then you should have access to the calendar as such:
uiCalendarConfig.calendars.myCalendar
This does not work for me. The object I return is always empty. What I'm trying to ultimately do is programmatically switch the view. If I myself used only fullcalendar, I would do this:
.fullCalendar( 'changeView', viewName )
How to do this using the ui-calendar directive?
Edit * My actual configuration object:
$scope.uiConfig = { calendar:{ height: 700, editable: true, timezone:'America/Los Angeles', ignoreTimezone:false, header:{ left: 'month basicWeek basicDay agendaWeek agendaDay', center: 'title', right: 'today prev,next' }, eventDrop: $scope.onEventDrop, eventClick : $scope.onEventClick, eventResize : $scope.onEventResize, viewDisplay : $scope.onViewDisplay } };
My actual calendar:
<div ui-calendar="uiConfig.calendar" ng-model="events" calendar="myCalendar"></div>
My controller:
app.controller('CalendarCtrl', function($scope, $http, $rootScope, uiCalendarConfig){