Anil Samal
Anil Samal

Reputation: 1053

uiCalendarConfig.calendars undefined in angular-ui/ui-calendar

I have taken the latest calendar.js from github for ui-calendar but the below code throws error.

$scope.changeView = function(view,calendar) {
uiCalendarConfig.calendars[calendar].fullCalendar('changeView',view);
};

Can someone guide me how to resolve the issue?Error is:

TypeError: Cannot read property 'calendars' of undefined

Upvotes: 0

Views: 1472

Answers (1)

MrHakala
MrHakala

Reputation: 26

Try naming your calendar eg. calendar="myCalendar"

After that you can access it with: uiCalendarConfig.calendars["myCalendar"]

https://github.com/angular-ui/ui-calendar#accessing-the-calendar-object

Upvotes: 1

Related Questions