title: angular-ui ui-calendar not updating on changes to Event Source Object / ng-model
body: <p>I'm adding fullcalendar.js to an angular app using <code>angular-ui</code> / <code>ui-calendar</code>.<br>
  (<code>angularjs 1.3.10</code>, <code>fullcalendar 2.2.6</code>, <code>ui-calendar 0.9.0-beta.1</code>, <code>jQuery 2.1.3</code>, <code>moment 2.9.0</code> &amp; <code>angular-moment 0.9.0</code>)</p>
  
  <p>In the calendar I'm using the <code>dayClick</code> as a datepicker type function to:<br>
  - write the selected date to scope (for other uses in the app)<br>
  - update the Event Source Object <code>events</code> array with the selected date<br>
  - display the selected date (ie newly updated <code>event</code>) on the calendar</p>
  
  <p>I have no problems completing the 1st two tasks, but the 3rd is not updating automatically.</p>
  
  <p>From the <a href="https://github.com/angular-ui/ui-calendar" rel="nofollow noreferrer">documentation</a>:<br>
  <code>An Event Sources objects needs to be created to pass into ng-model.
  This object's values will be watched for changes. If a change occurs, then that specific calendar will call the appropriate fullCalendar method.</code></p>
  
  <p>However it doesn't seem to be updating the calendar this automatically...</p>
  
  <p>Is this a bug in <code>ui-calendar</code> or am I missing something ?</p>
  
  <p>Interestingly if I have the calendar in an <code>ng-if</code> tab, and toggle between the tabs, the calendar updates correctly (after the toggle).  </p>
  
  <p>See this <a href="http://jsfiddle.net/goredwards/y2du0yqw/" rel="nofollow noreferrer">jsfiddle</a> and:<br>
  - run, then select a date (notice the <code>events</code> array is updated correctly)<br>
  - toggle Tab 2 then back to Tab 1 - notice the date now displays correctly...</p>
  
  <p>html looks like:</p>
  
  <pre><code>&lt;div ui-calendar="uiConfig.calendar" ng-model="calendarDate" calendar="myCalendar1"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>Controller code looks like</p>
  
  <pre><code>myApp.controller('MainCtrl', function($scope, $filter, moment, uiCalendarConfig){
  
      $scope.calendarDate = [
          {
              events: [
                  {
                      title: 'From',
                      start: '2015-01-31',
                      allDay: true,
                      rendering: 'background',
                      backgroundColor: '#f26522',
                  },
              ],
          }
      ];
  
      $scope.setCalDate = function(date, jsEvent, view) {
              var dateFrom = moment(date).format('YYYY-MM-DD');                   // set dateFrom based on user click on calendar
              $scope.calendarDate[0].events[0].start = dateFrom;              // update Calendar event dateFrom
              $scope.dateFrom = $filter('date')(dateFrom, 'yyyy-MM-dd');;         // update $scope.dateFrom
      };
  
      $scope.uiConfig = {
          calendarFrom : {
              editable : false,
          aspectRatio: 2,
              header : {
                  left : 'title',
                  center : '',
                  right : 'today prev,next'
              },
              dayClick : $scope.setCalDate,
              background: '#f26522',
          },
      };
  });
  </code></pre>
  
  <p>PS had a look at <a href="https://stackoverflow.com/questions/23006464/angularjs-ui-calendar-not-updating-events-on-calendar">this</a> question (which is similar) but was asked quite a few versions ago - plus the suggested solution <code>calendar.fullCalendar('refetchEvents');</code> doesn't work since the <code>calendar</code> object is not defined - unsure what <code>calendar.fullCalendar</code> would be for my code...</p>