angularjs ui-calendar Unable to read property "calendars" of indefinite


I followed the instruction here: to create calendar in angularjs. However, when I tried uiCalendarConfig.calendars[calendar].fullCalendar('render'); it cause an error TypeError: Cannot read property 'calendars' of undefined.

I did add ui-calendar as dependency in my controller and uiCalendarConfig in my function's parameter. A ll latest version of the javascript:

<script src="//"></script>
<script src="resources/js/calendar.js"></script>
<script src="resources/js/fullcalendar.js"></script>

My HTML looks like this:

<div ui-calendar="uiConfig.calendar" class="span8 calendar" ng-model="eventSources"></div>

Anyone figure out what I missed that causes the error?


Its a known issue in angular ui-calendar

please check the issue and it's solution here