title: Accessing fullcalendar object in Angular ui-calendar
body: <p>I am trying to access the fullcalendar object in ui-calendar. The docs say that all I need to do is give the calendar attribute a name:</p>
  
  <pre><code>&lt;div ui-calendar="calendarOptions" ng-model="eventSources" calendar="myCalendar"&gt;
  </code></pre>
  
  <p>Then, you should be able to access the calendar as such:</p>
  
  <pre><code>uiCalendarConfig.calendars.myCalendar
  </code></pre>
  
  <p>This is not working for me. The object I get back is always empty. What Im trying to ultimately do is programatically switch the view. If I was using just fullcalendar by itself, this is how I would do it:</p>
  
  <pre><code>.fullCalendar( 'changeView', viewName )
  </code></pre>
  
  <p>How do I do this using the ui-calendar directive?</p>
  
  <p>Edit* My actual config object:</p>
  
  <pre><code>$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
  
      }
  };
  </code></pre>
  
  <p>My actual calendar directive call:</p>
  
  <pre><code>&lt;div ui-calendar="uiConfig.calendar" ng-model="events" calendar="myCalendar"&gt;&lt;/div&gt; 
  </code></pre>
  
  <p>My controller:</p>
  
  <pre><code>app.controller('CalendarCtrl', function($scope, $http, $rootScope, uiCalendarConfig){
      // bunch of methods plus $scope.uiConfig as shown above
      // console.log(uiCalendarConfig) outputs {} 
  });
  </code></pre>